2011 Sep 16 8:50 AM
Hi Everyone,
I have created a custom infotype 9200 where i have four field bunching (zband01, zgrade01, zcurrp01, zrmrks01, zbandp02...upto 10 repeations) in PS9200 structure. I have created another structure ZQ9200 with just the above four fields in the structure. This structure field names are assigned to the table control layout fields in the module pool.
I created another internal table and workarea with the same four field structure in the program. In PAI, in the 'loop with control TC', i am populating the internal table first. Then after the loop ends, i am loopinf the internal table and populating the P9200 structure.
Problem here is in pa30, if i want to create a record to IT 9200, i am entering the values in the table control but could not hold the values after I press the 'Enter' button.
PLease do help me.
Hi Everyone,
I have created a custom infotype 9200 where i have four field bunching (zband01, zgrade01, zcurrp01, zrmrks01, zbandp02...upto 10 repeations) in PS9200 structure. I have created another structure ZQ9200 with just the above four fields in the structure. This structure field names are assigned to the table control layout fields in the module pool.
I created another internal table and workarea with the same four field structure in the program. In PAI, in the 'loop with control TC', i am populating the internal table first. Then after the loop ends, i am loopinf the internal table and populating the P9200 structure.
Problem here is in pa30, if i want to create a record to IT 9200, i am entering the values in the table control but could not hold the values after I press the 'Enter' button.
PLease do help me.
2011 Sep 16 9:11 AM
Hi
It would be something like this
PROCESS BEFORE OUTPUT.
* general infotype-independent operations
MODULE before_output.
CALL SUBSCREEN subscreen_empl INCLUDING empl_prog empl_dynnr.
CALL SUBSCREEN subscreen_header INCLUDING header_prog header_dynnr.
* infotype specific operations
MODULE p9991.
LOOP AT g_tabla WITH CONTROL g_d_tc INTO g_wa.
MODULE pbo_tc.
ENDLOOP.
************+
PROCESS AFTER INPUT.
*---------------------------------------------------------------------*
* process exit commands
*---------------------------------------------------------------------*
MODULE exit AT EXIT-COMMAND.
*---------------------------------------------------------------------*
* processing after input
*---------------------------------------------------------------------*
*
* check and mark if there was any input: all fields that
* accept input HAVE TO BE listed here
*---------------------------------------------------------------------*
CHAIN.
FIELD p9991-begda.
FIELD p9991-endda.
MODULE input_status ON CHAIN-REQUEST.
ENDCHAIN.
*---------------------------------------------------------------------*
* process functioncodes before input-checks *
*---------------------------------------------------------------------*
MODULE pre_input_checks.
*---------------------------------------------------------------------*
* input-checks: *
*---------------------------------------------------------------------*
LOOP.
MODULE pai_tc.
ENDLOOP.
* insert check modules here:
* ...
*&---------------------------------------------------------------------*
*& Module PBO_TC OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module PBO_TC output.
MOVE-CORRESPONDING G_WA TO ZQ9991.
endmodule. " PBO_TC OUTPUT
*&---------------------------------------------------------------------*
*& Module PAI_TC INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE pai_tc INPUT.
MOVE-CORRESPONDING zq9991 TO g_wa.
PERFORM tc_update TABLES g_tabla
USING g_wa
g_d_tc-current_line.
ENDMODULE. " PAI_TC INPUT
*&---------------------------------------------------------------------*
*& Form TC_UPDATE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_G_TABLA text
* -->P_G_WA text
* -->P_G_D_TC_CURRENT_LINE text
*----------------------------------------------------------------------*
FORM tc_update TABLES p_tabla
USING value(p_datos)
value(p_linea).
READ TABLE p_tabla
TRANSPORTING NO FIELDS
INDEX p_linea.
IF sy-subrc = 0.
MODIFY p_tabla FROM p_datos INDEX p_linea.
ELSE.
APPEND p_datos TO p_tabla.
ENDIF.
ENDFORM. " TC_UPDATE
2011 Sep 17 5:47 AM
Hi Jose,
First of all, thanx for your reply.
After implementing your logic, I could hold the values in the screen of PA30 and create a record in the underlying database table. But the Table Control in the screen has all its line items active or available for input.
I want the first line item of Table Control to be active and rest all be grayed. If I press 'Enter' after entering all fields in line item 1, 2nd line item should become active or available for input.
Please suggest me.
Regards,
Anil Kumar Ch
2011 Sep 17 1:55 PM
Hi
In that case you may use a logic like this:
.....
MODULE TC_INIT.
LOOP AT g_tabla WITH CONTROL g_d_tc INTO g_wa.
MODULE pbo_tc.
ENDLOOP.
....
*&---------------------------------------------------------------------*
*& Module TC_INIT OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE tc_init OUTPUT.
DESCRIBE TABLE g_tabla LINES g_d_tc-lines.
g_d_tc-lines = g_d_tc-lines + 1.
ENDMODULE. " TC_INIT OUTPUT
Basically what we are doing here, is set the number of editable lines to one more than the actual number of lines with data in the internal table, so when you are creating the first time, only the first row will be available for input, when you insert something in that first line, the second one becomes active, and so forth...
2011 Sep 16 11:55 AM
hi,
maybe if you need a TC in the module pool you have to create a Tabled Infotype ( like the std Pa0008 ) .
So try to re create your custom infotype with this option and then test the module pool geneterated by the wizard...
regards.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |