Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV field value issue

Former Member
0 Likes
1,015

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,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
993

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

9 REPLIES 9
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
993

How you have built the fieldcatalog ??

Read only

0 Likes
993

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.

Read only

Former Member
0 Likes
993

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

Read only

0 Likes
993

I checked in dubugging its getting data there, but when i passed the table in the FM its not showing

Read only

sarbajitm
Contributor
0 Likes
993

Are you creating the fieldcatalog manually or creating it using FM REUSE_ALV_FIELDCATALOG_MERGE?

Please Reply.

Read only

Former Member
0 Likes
993

Creating mannually

Read only

0 Likes
993

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.

Read only

Former Member
0 Likes
994

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

Read only

0 Likes
993

Hi Siddarth Problem solved with your suggesion. Thank you...Great Help