Application Development 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: 

How to Update line items in a structure ?

Former Member
0 Kudos
225

Hi i am getting 3 line items retrieved from a Function Module. But while displaying in the script it shows only the last line item. How do i update all the line items??

The code is given below,

    CALL FUNCTION 'FI_PRINT_ZTERM'
         EXPORTING
              I_ZTERM         = EKKO-ZTERM
              I_LANGU         = EKKO-SPRAS
              I_XT052U        = ' '
              I_T052          = T052
         TABLES
              T_ZTEXT         = ZBTXT
         EXCEPTIONS
              ZTERM_NOT_FOUND = 01.


Loop at ZBTXT.
    READ TABLE ZBTXT.
    IF SY-SUBRC EQ 0.
      PEKKO-ZBTXT = ZBTXT-LINE.
      DELETE ZBTXT INDEX 1.
*      UPDATE PEKKO-ZBTXT.

    MOVE ZBTXT-LINE TO PEKKO-ZBTXT.
    ENDIF.
ENDLOOP.

And also how do i retrieve it in the script ?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
82

Hi,

Refer

Regards

5 REPLIES 5

Former Member
0 Kudos
82

HI Navaneethan,

please try following code.

make PEKKO should be internal table with appropraite structure..

Loop at ZBTXT.

MOVE ZBTXT-LINE TO PEKKO-ZBTXT.

append PEKKO.

clear PEKKO.

ENDLOOP.

loop at pekko.

write : / PEKKO-zbtxt.

endloop.

if above code is helpful, REWARD POINTS.

Regards,

Ranjith

0 Kudos
82

hi ranjith,

so the itab shud be like,

DATA : BEGIN OF pekko OCCURS 0,

zbtxt like pekko-zbtxt,

END OF pekko.

0 Kudos
82

hi

I tried out the method given above... but it is showing only the last line item.

how to display all the line items?

0 Kudos
82

Please try following code. pekko. should be an internal table.. occurs 0.

loop at pekko.

write : / PEKKO-zbtxt.

endloop.

Former Member
0 Kudos
83

Hi,

Refer

Regards