design by leezec 296066606
Example program: deeply customized product pricing
Single header table xmdtuc_t
Detail table xmduuc_t
Provide the packaged program and table structure
T100 double file development program example - Internet document resources - CSDN Library
Basic requirements:
- The document should be coded automatically
- When entering, the document date is brought in, including the recorder and the Department of the recorder
- Status control: cannot be voided after approval; cannot be approved after voiding
- Function control: after approval, the document cannot be changed or deleted
- Items should be automatically incremented
There is no template for the above T100 standard output
start
- Create table: adzi140 enters the operation, first create the header table, and then create the detail table. After the design is completed, execute the change. Note that the foreign key must be used to create the detail table. Otherwise, the screen generator cannot recognize the association between the two tables, and the resulting template has problems
- Registration procedure: azzi900 enter the procedure number cxmt701
- Open T100 designer and check out the specification and program at the same time
- Adjust status code: adzi150 select the required status code function and adjust the order
- Generate specification template: adzp168 picture generator, design specification style
Template type selection, full page and list mode
In the field setting tab, add a single header table first, and then a detail table. If the double table has foreign keys, there will be a hierarchical relationship as shown in the figure. Then add the required fields to the structure bar on the right, and then generate the screen
- The designer downloads the specifications, adjusts the length, position and other beautification work, and uploads the specifications
- Designer download program, upload directly
- Add document nature: azzi600 query the data with the system classification code of 24, then edit and enter the new document nature. The document nature is consistent with the program number
- Registration operation No.: azzi910 input. Select the program number entered in the previous step for the nature of the document. At this time, the program can be executed, but the key functions are missing and need to be supplemented by yourself
- Doc type setting: aooi199, edit and add the doc type required by the dual file program
- Doc type parameter maintenance: aooi200, add the doc type required by the dual file program again
- Automatic document numbering function
Define an array in the global variable customization area: DEFINE g_ooef RECORD LIKE ooef_t.* stay cxmt701_init()Function add value SELECT * INTO g_ooef.* FROM ooef_t WHERE ooefent = g_enterprise AND ooef001 = g_site stay cxmt701_input(p_cmd)function ON ACTION controlp INFIELD xmdtucdocno Segment add windowing selection #Windowing section i INITIALIZE g_qryparam.* TO NULL LET g_qryparam.state = 'i' LET g_qryparam.reqry = FALSE LET g_qryparam.default1 = g_xmdtuc_m.xmdtucdocno #Give default value #Give arg LET g_qryparam.arg1 = g_ooef.ooef004 LET g_qryparam.arg2 = g_prog CALL q_ooba002_1() #Call to open the window LET g_xmdtuc_m.xmdtucdocno = g_qryparam.return1 DISPLAY g_xmdtuc_m.xmdtucdocno TO xmdtucdocno # NEXT FIELD xmdtucdocno #Return to the original field Single head after input Add number to segment #Add point: name="input.head.b_insert" before adding a header LET l_success = NULL CALL s_aooi200_gen_docno(g_site,g_xmdtuc_m.xmdtucdocno,g_xmdtuc_m.xmdtucdocdt,g_prog) RETURNING l_success,g_xmdtuc_m.xmdtucdocno IF NOT l_success THEN CALL s_transaction_end('N','0') CONTINUE DIALOG END IF #end add-point
- The default value function is provided when the processing program is entered
stay cxmt701_insert()Add single header preset value of function #Add point: single header preset value name="insert.default" LET g_xmdtuc_m.xmdtucsite = g_site #Set up a stronghold LET g_xmdtuc_m.xmdtucdocdt = cl_get_today() #Document date LET g_xmdtuc_m.xmdtuc001 = g_user #applicant LET g_xmdtuc_m.xmdtuc002 = g_dept #Applicant department LET g_xmdtuc_m.xmdtuc004 = cl_get_today() #effective date #end add-point
- Function of processing document status code change
stay cxmt701_statechange()function MENU "" ATTRIBUTES (STYLE="popup")Add at the editable area below: #Add point: name="statechange.before_menu" before menu CALL cl_set_act_visible("open,valid,void",FALSE) #Block all functions CASE g_xmdtuc_m.xmdtucstus #Judge document status WHEN "N" CALL cl_set_act_visible("valid,void",TRUE) #If it is not approved, it can be voided and approved WHEN "X" CALL cl_set_act_visible("open",TRUE) #When voiding, you can cancel the approval WHEN "Y" CALL cl_set_act_visible("open",TRUE) #When approving, you can cancel the approval END CASE #end add-point
- Process the change and deletion function after document approval
stay cxmt701_set_act_visible()Function editable area #add-point:set_act_visible segment name="set_act_visible.set_act_visible" CALL cl_set_act_visible("modify,delete,modify_detail",TRUE) #Open change, delete, detail change function #end add-point stay cxmt701_set_act_no_visible()Function editable area #add-point:set_act_no_visible segment name="set_act_no_visible.set_act_no_visible" IF g_xmdtuc_m.xmdtucstus NOT MATCHES "[NDR]" THEN #When the document status is not unapproved CALL cl_set_act_visible("modify,delete,modify_detail",FALSE) #It is not allowed to change, delete and detail change functions END IF #end add-point
- Ln increment function when processing detail entry
stay cxmt701_input(p_cmd)Detail of function BEFORE INSERT Editable area #Add point: modify segment before insert name="input.body.before_insert" #Item number SELECT MAX(xmduucseq)+1 INTO g_xmduuc_d[l_ac].xmduucseq FROM xmduuc_t WHERE xmduucent = g_enterprise AND xmduucdocno = g_xmdtuc_m.xmdtucdocno IF cl_null(g_xmduuc_d[l_ac].xmduucseq) OR g_xmduuc_d[l_ac].xmduucseq = 0 THEN LET g_xmduuc_d[l_ac].xmduucseq = 1 END IF #end add-point
Program preview:
If you want to know the direction and content, you can leave a message in the comment area and publish it when you have time