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

Including the internal table in Srcript Form

Former Member
0 Likes
1,148

Hi all

i am collecting all the data into an internal table in the print program of the Script, now i want to pass that internal table under the text element DELPOS. so my internal table contain item data, so i want every item to be printed on the form

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,126

Hi,

You need call the element in your main window of the script.

/E DELPOS

Under this thing you need to specify the internal table fields like

  • &itab-matnr& &itab-erdat&, whatever fields you have.

So that all the items line sof your internela table will be displayes in your form.

10 REPLIES 10
Read only

Former Member
0 Likes
1,127

Hi,

You need call the element in your main window of the script.

/E DELPOS

Under this thing you need to specify the internal table fields like

  • &itab-matnr& &itab-erdat&, whatever fields you have.

So that all the items line sof your internela table will be displayes in your form.

Read only

0 Likes
1,126

can i use write_form in the loop of the print program, as i want it for every item Number of that particular delivery number.

Read only

0 Likes
1,126

Yes, you can.

LOOP AT ITAB.

CALL FUNCTION WRITE_FORM.

ENDLOOP.

ashish

Read only

0 Likes
1,126

my previous FORM editor contains like this

LI &VBPLP-POSNR(I6)&,,&MATERIAL&,,&BOXES&,,&VBPLP-VEMNG(11.0)&

= &VBPLP-VEMEH&,,&ITEM_WEIGHT& &GROSS_WEIGHT_UNIT&

can i replace them with the data from the internal table..wont there be any problem.

Read only

0 Likes
1,126

It depends upon your requirement. Looks like this layout is related to Delivery.

Currently it is printing Item data such as Item no, Material, No of Box, Quantity, unit etc.

If you want to comment existing lines and call your internal table, you can do that or you can create a new text element and call the same in your program. Just make sure that why code mentioned is not going to work for you and if you comment that, it should not create any problem to any data printing in layout.

ashish

Read only

0 Likes
1,126

Hi,

You can comment it out and place your code instead of replacing....

for commenting use syntax /*

Read only

0 Likes
1,126

If i create a new text element will that not affect the other data which i want to display. i mean if the print program uses other form also.

and also i want to know one thing if i created that a element that will be specific to the form itself ?.

Read only

0 Likes
1,126

You need to make sure that the associated print program is only used to print this layout. If this print program is used to print multiple layouts, then you need to add condition something like IF FORM_NAME = "ZXXX" then call this text element.

If you create a text element, that will be specific to this form only, as you will be creating it in that form.

Hope this helps.

ashish

Read only

0 Likes
1,126

Hi,

As you will be calling the specific form only which you want, as you will be passing in the OPEN_FORM function module, it will not effect the other form.

You will not have any issues with data, as data is in main window. If it exceeds it will overflow to next page.

Read only

Former Member
0 Likes
1,126

Check if this helps.

Create an element in SAP Script window which will print internal table data.

In your print program, LOOP at your internal table and inside loop call WRITE_FORM function module to print the text element.

In this way you can print all records of internal table to a form.

ashish