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

Problem in populating internal table data

Former Member
0 Likes
556

Dear Guru

here i have encountered an issue in populating and internal table's data into a SAP-Script Form.

char1_val_tab_1 is an internal table and i am trying to populate its

char1_val_tab_1-atnam -->> characteristics names

char1_val_tab_1-atflv --->> characteristics value

into a sap-script form.

so in sapscript's from i have passed this two variable

like below

&char1_val_tab_1-atnam&

&char1_val_tab_1-atflv&

and in driver prog of that sap-script form i have written code like below in order to populate all the lines of these internal table char1_val_tab_1

LOOP at char1_val_tab_1.
   
   PERFORM write_form USING 'ITEM' ' ' ' ' 'MAIN'.


ENDLOOP.

But the issue i am facing -


>> this looping only printing the last line of that internal table but i want from 1st line to last line.

I did PERFORM write_form USING 'ITEM' ' ' ' ' 'MAIN'.

with following code and its not coming... it is showing only last line of that internal table into sap-scripts o/p

FORM write_form USING p_element
                      p_function
                      p_type
                      p_window.
  CALL FUNCTION 'WRITE_FORM'
      EXPORTING
           element                  = p_element
*            function                 = p_function
*            type                     = p_type
           window                   = p_window
*       IMPORTING
*            PENDING_LINES            =
       EXCEPTIONS
            element                  = 1
            function                 = 2
            type                     = 3
            unopened                 = 4
            unstarted                = 5
            window                   = 6
            bad_pageformat_for_print = 7
            OTHERS                   = 8.
ENDFORM.                               " WRITE_FORM

so guru i want to know what are the necessary changes i should make in to above looping in order to print 1st line to last line of that internal table char1_val_tab_1.

Pls help

Thanx & Regards

Saifur Rahaman

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

Pass parameter function = 'APPEND' in the FM write_form

LOOP at char1_val_tab_1.

PERFORM write_form USING 'ITEM' 'APPEND' ' ' 'MAIN'.

ENDLOOP.

FORM write_form USING p_element

p_function

p_type

p_window.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = p_element

  • function = p_function

  • type = p_type

window = p_window

  • IMPORTING

  • PENDING_LINES =

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

OTHERS = 8.

ENDFORM. " WRITE_FORM

Regards,

Joy.

5 REPLIES 5
Read only

Former Member
0 Likes
532

Pass parameter function = 'APPEND' in the FM write_form

LOOP at char1_val_tab_1.

PERFORM write_form USING 'ITEM' 'APPEND' ' ' 'MAIN'.

ENDLOOP.

FORM write_form USING p_element

p_function

p_type

p_window.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = p_element

  • function = p_function

  • type = p_type

window = p_window

  • IMPORTING

  • PENDING_LINES =

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

OTHERS = 8.

ENDFORM. " WRITE_FORM

Regards,

Joy.

Read only

0 Likes
531

Hi Jyoti da

thats it i have to do ??

let me try it ... give me some times to icorporate this with my prog.

i will update u after some times..

Thanx & Regards

Saifur Rahaman

Read only

0 Likes
531

Dear Sir

This 'APPEND' parameter not able to print all the lines of that internal table ..

wot to do now ??

Read only

0 Likes
531

Whether u r facing the same prob.? or it is diff. one? pl. provide the details....

Regards,

Joy.

Read only

0 Likes
531

Dada,

I have solved the problem using line index its now printing all the lines of that internal table

Thanks & reagards

Saifur Rahaman