2014 Feb 01 4:25 AM
Hi All,
i am working on a table contol in module pool programming.
Now i have three columns in my control table.
In my user_command_0100 input, i have written these code,
so that when user hits enter, he will get two fields filled in table control.
MODULE USER_COMMAND_9000 INPUT.
WHEN 'ENTER'.
PERFORM DISP_DATA.
Now, inside FORM disp_data. i am selecting two fields from a table.
FORM DISP_DATA .
SELECT MANDT FIELD1 FIELD2
FROM ZTABLE
INTO TABLE IT_FINAL.
ENDFORM.
Now the problem is that, when user hits first enter , the two fields gets filled in my table control.
But the third filled will be filled by user on runtime.
So, the problem is that, when user fills the third field and again hits enter, the value entered by him gets disappeared.
Because it again initialize only two fields, but my requirement is when user fills third field value at run time,
it should retain in table control.
Please tell me what changes i have to perform, in the above code.
2014 Feb 01 5:28 AM
Hi Srikant,
i think whatever Arun is sujjesting is right, but please change your code as shown below
@, i think he has to use if it_final[] is initial, isn't it.
WHEN 'ENTER'.
PERFORM DISP_DATA.
FORM DISP_DATA .
IF IT_FINAL[] IS INITIAL.
SELECT MANDT FIELD1 FIELD2
FROM ZTABLE
INTO TABLE IT_FINAL.
ENDIF.
ENDFORM.
2014 Feb 01 4:39 AM
Hi Srikant,
Modify your internal table. and its better to use work area if possible.
Sample code to modify
MODIFY ITRGPDET
FROM WARGPDET
INDEX RGPTBL1021-CURRENT_LINE.
IF SY-SUBRC <> 0.
APPEND ITRGPDET.
ENDIF.
Here ITRGPDET is internal table and WARGPDET is work area.
Thanks,
Ranjit K.
2014 Feb 01 5:01 AM
Hello Srikant Jain.
* INTO TABLE statement overwrites the internal table data every time you press ENTER.
* In the form DISP_DATA, you write:
if IT_FINAL[] is not initial.
if IT_FINAL[] is initial.
SELECT MANDT FIELD1 FIELD2 FROM ZTABLE
INTO TABLE IT_FINAL.
endif.
Regards.
2014 Feb 01 5:28 AM
Hi Srikant,
i think whatever Arun is sujjesting is right, but please change your code as shown below
@, i think he has to use if it_final[] is initial, isn't it.
WHEN 'ENTER'.
PERFORM DISP_DATA.
FORM DISP_DATA .
IF IT_FINAL[] IS INITIAL.
SELECT MANDT FIELD1 FIELD2
FROM ZTABLE
INTO TABLE IT_FINAL.
ENDIF.
ENDFORM.
2014 Feb 01 5:44 AM
2014 Feb 01 5:46 AM