Skip to Content
0
Jan 24, 2023 at 05:44 PM

How to properly filter and transfer local table to local structure?

51 Views Last edit Jan 24, 2023 at 06:06 PM 3 rev

Local tables:

  • LT_VBFA and LT_VBFA_TMP which has the same exact content.
  • LT_VBFA_AUX

LT_VBFA and LT_VBFA_TMP content:
I was trying to get the ROW 8 but instead, I was getting the ROW 6. I need to get the MJAHR and VBELN/VBELV of ROW 8.

image.png

Local structure:

  • LX_VBFA

Here's my code:

        lt_vbfa_aux[] = VALUE #( FOR lx_vbfa IN lt_vbfa[]
WHERE ( vbtyp_n = lcl_main=>C
OR vbtyp_n = lcl_main=>J )
( VALUE #( BASE CORRESPONDING #( lx_vbfa )
vbelv = lx_vbfa-vbeln
matnr = VALUE #( lt_vbfa[
vbelv = lx_vbfa-vbelv
vbtyp_n = lcl_main=>R ]-matnr OPTIONAL )
mjahr = VALUE #( lt_vbfa[
vbelv = lx_vbfa-vbelv
vbtyp_n = lcl_main=>R ]-mjahr OPTIONAL ) ) ) ).

Attachments

image.png (193.5 kB)