Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3316

Re: Dynamic ALV: Field Name blank

$
0
0

Hello,

 

The names of the fields are picked up from Data elements. But since you do not have DEs for some fields, the headings are coming as Blank.

 

You have two options:

1. Create field names statically of all the field names of the dynamic structures using case statement in the loop as below:

 

LOOP AT lt_dfies INTO    ls_dfies.

 

  CLEAR ls_fieldcat.

 

  MOVE-CORRESPONDING ls_dfies TO ls_fieldcat.

  CASE ls_dfies-fieldname.

     when 'FIELD1'

          ls_fieldcat-scrtext_m = 'Lable of Field 1'.

     when 'FIELD2'

          ls_fieldcat-scrtext_m = 'Lable of Field 1'.

     when 'FIELD3'

          ls_fieldcat-scrtext_m = 'Lable of Field 1'.

  ENDCASE.

 

  APPEND ls_fieldcat TO lit_fieldcat.

 

ENDLOOP.

 

2. Create DEs for the fields of the dynamic structures.

 

The first approach is static and you would have to know all the structures and fields in advance which this ALV is going to handle.

 

The second approach is the best since then you ALV will be completely dynamic and can handle any structure.

 

Thanks,

Ajeet Dixit.


Viewing all articles
Browse latest Browse all 3316

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>