cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP New Syntax: Deep Table issue

0 Kudos
293

Hi All,

I am facing below issue with LT_ITEM table which is deep structure :

et_output = VALUE # ( FOR LS_ITEM IN LT_ITEM

( DEL_NUM = LS_ITEM-DELNUM

PO_NUM = VALUE #( LS_ITEM-REFDOC[ DOCCAT = 'SO' ]-REFDOC_NUM OPTIONAL )

PO_ITM = VALUE #( LS_ITEM-REFDOC[ DOCCAT = 'SO' ]-REFITM_NUM OPTIONAL ) ).

In above table ET_OUTPUT , only DEL_NUM field comes populated although LT_ITEM-REFDOC has value field for condition DOCCAT = 'SO' .

I tried multiple threads like below but did not get rootcause of the issue. Ccan anyone suggest why PO_NUM and PO_ITM are not populated

https://answers.sap.com/questions/748917/new-syntax-for-deep-structure--an-internal-table-i.html

Ryan-Crosby
Active Contributor
0 Kudos

The values for those fields would be missing if the REFDOC table does not have an entry for DOCCAT = 'SO', which must be the case here.

VXLozano
Active Contributor
0 Kudos

Did you checked the proper row? I mean, you say "LT_REFDOC has value for condition SO", but does the row you are trying to add have it?
(just wondering, although I hate new syntax because its readability, the sentence seems ok from here)

0 Kudos

Yes Indeed It has a value with DOCCAT = 'SO' . Problem is LS_ITEM-REFDOC when comes to new syntax is Blank although LT_ITEM has value. The value from current iteration comes to DEL_NUM field. Unfortunately I cannot debug it. So not sure why only parent table values comes to work area and not child table

VXLozano
Active Contributor
0 Kudos

Another nice advantage of the new syntax, yes... easier to debug (you just can press F5)... The behaviour you describe reminds me of the old sentence AT NEW, what delivered ### for some fields of the workarea. Maybe you are hitting the same wall through a new wallpaper 😞

My advice, if possible, change that FOR for a LOOP ASSIGNING. Your life will be easier.

Sandra_Rossi
Active Contributor
0 Kudos

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Sandra_Rossi
Active Contributor
0 Kudos

Your code has no complexity, so it should do exactly what we see, and the issue is probably that you can't just see the "obvious" problem.

If you provide the data for the internal table (and nested internal table) with one example of the data which doesn't work, people (or even yourself) could see what the problem is.

Please provide data like this:

 LT_ITEM = VALUE #( 
           ( delnum = '...'
             refdoc = VALUE #(
                      ( doccat = 'SO' refdoc_num = '...' refitm_num = '...' )
                      ( ... ) ) ) ).

Accepted Solutions (0)

Answers (0)