2009 Mar 16 1:46 PM
Hi,
I am using ALV disaplay FM for displaying data in the form of ALV format. in the O/P one field is not getting data it showing empty column. This field is referrening by new data type it was not there in any database table.
Thanks,
2009 Mar 16 1:57 PM
Hi,
In the internal table do you have the fields of KEY_1 and KEY_2...
and also mention the field name status in capital letters and then check if its working
just copy and paste the code given below....
wa_field1-fieldname = 'KEY_1'.
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 10.
wa_field1-col_pos = 1. " added
wa_field1-seltext_l = 'Key 1'.
APPEND wa_field1 TO it_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'KEY_2'.
wa_field1-col_pos = 2. " added
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 10.
wa_field1-seltext_l = 'Key 2'.
APPEND wa_field1 TO it_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'STATUS'. " changed
wa_field1-col_pos = 3. " added
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 30.
wa_field1-seltext_l = 'Status'.
APPEND wa_field1 TO it_field1.Regards,
Siddarth
Hi,
I am using ALV disaplay FM for displaying data in the form of ALV format. in the O/P one field is not getting data it showing empty column. This field is referrening by new data type it was not there in any database table.
Thanks,
2009 Mar 16 1:47 PM
2009 Mar 16 1:56 PM
wa_field1-fieldname = 'KEY_1'.
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 10.
wa_field1-seltext_l = 'Key 1'.
APPEND wa_field1 TO it_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'KEY_2'.
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 10.
wa_field1-seltext_l = 'Key 2'.
APPEND wa_field1 TO it_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'status'.
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 30.
wa_field1-seltext_l = 'Status'.
APPEND wa_field1 TO it_field1.
Here is the code and KEY_1, KEY_2 is the data base field but status is not DB table, it referrering new data type. 'zpu_scapprover_tab_alv' is internal table.
tables :zpu_scapprover.
data : begin of zpu_scapprover_tab occurs 0,
MANDT type MANDT,
role(4),
key_1(10),
key_2(10),
status(30), "New field not in DB
end of zpu_scapprover_tab.
data : zpu_scapprover_tab_alv like standard table of zpu_scapprover_tab with header line.
2009 Mar 16 1:56 PM
Step 1:
Debug and check that are you getting data in the field.
Step 2:
CHECK the fieldcatlog....
FIELDCATALOG-FIELDNAME = 'FIELD'.
FIELDCATALOG-SELTEXT_M = 'TEXT'.
FIELDCATALOG-COL_POS = 1.
FIELDCATALOG-TABNAME = 'INTERNAL TABLE'. " IF ANY
APPEND FIELDCATALOG TO FIELDCATALOG.
CLEAR FIELDCATALOG.Regards,
Gurpreet
2009 Mar 16 2:14 PM
I checked in dubugging its getting data there, but when i passed the table in the FM its not showing
2009 Mar 16 1:57 PM
Are you creating the fieldcatalog manually or creating it using FM REUSE_ALV_FIELDCATALOG_MERGE?
Please Reply.
2009 Mar 16 2:15 PM
2009 Mar 16 2:19 PM
Hi,
Check the field name in internal table and the ones passing to field cat r matching or not.
Also pass the internal table name in CAPS. Please paste the part of the internal table declaration.
Thanks,
Vinod.
2009 Mar 16 1:57 PM
Hi,
In the internal table do you have the fields of KEY_1 and KEY_2...
and also mention the field name status in capital letters and then check if its working
just copy and paste the code given below....
wa_field1-fieldname = 'KEY_1'.
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 10.
wa_field1-col_pos = 1. " added
wa_field1-seltext_l = 'Key 1'.
APPEND wa_field1 TO it_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'KEY_2'.
wa_field1-col_pos = 2. " added
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 10.
wa_field1-seltext_l = 'Key 2'.
APPEND wa_field1 TO it_field1.
CLEAR wa_field1.
wa_field1-fieldname = 'STATUS'. " changed
wa_field1-col_pos = 3. " added
wa_field1-tabname = 'zpu_scapprover_tab_alv'.
wa_field1-outputlen = 30.
wa_field1-seltext_l = 'Status'.
APPEND wa_field1 TO it_field1.Regards,
Siddarth
2009 Mar 16 2:17 PM
Hi Siddarth Problem solved with your suggesion. Thank you...Great Help