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

lables in scripts--urgent

Former Member
0 Likes
1,579

Hi Gurus,

i created labels like this :

In the maintenance window, choose Edit ® Windows ® Create ® Labels.

The dialog window for editing a main window appears.

In the group box Area enter the left and the upper margins as well as the area width and hight of the individual labels.

In the group box Horizontal enter the horizontal distance between the labels and the number of labels.

In the group box Vertical enter the vertical distance between the labels and the number of labels.

In the group box Positions enter the starting position.

now how to add the contents to the labels..

say i created 5 lables horizantally and vertically 3 rows..so i have 15 labesl..

now hot ot pass the text to them...

when i give a txt..it prinitin gonly once thth too on the first label alone ..?

the text element for all the mainwindow(ie the lables) are the same..but getting printed only once..

so how to print for all lables?

and is it possible to pass diffent tect to differnt labels??

i really appreciate ur help....

Hi Gurus,

i created labels like this :

In the maintenance window, choose Edit ® Windows ® Create ® Labels.

The dialog window for editing a main window appears.

In the group box Area enter the left and the upper margins as well as the area width and hight of the individual labels.

In the group box Horizontal enter the horizontal distance between the labels and the number of labels.

In the group box Vertical enter the vertical distance between the labels and the number of labels.

In the group box Positions enter the starting position.

now how to add the contents to the labels..

say i created 5 lables horizantally and vertically 3 rows..so i have 15 labesl..

now hot ot pass the text to them...

when i give a txt..it prinitin gonly once thth too on the first label alone ..?

the text element for all the mainwindow(ie the lables) are the same..but getting printed only once..

so how to print for all lables?

and is it possible to pass diffent tect to differnt labels??

i really appreciate ur help....

11 REPLIES 11
Read only

Former Member
0 Likes
1,552

Sorry ..I can't undersatnd what you wrote.

What we do in scripts to be maintained labels, create one customizing table ..maintain all the labels in that table, Then you can call the labels.

Corrrct me If i am wrong.

regards,Ram

Read only

0 Likes
1,552

I created say 15 labels in a page.

And i went to edit->Textelement adn worte a text.

when i double click each main window(each lable) to edit the text ..all the lables contains the same text that i gave .

but when i execute i am able to see the text only in one lable.its not coming for al the 15 lables.

can u help me?

Read only

0 Likes
1,552

can u help me with steps how to create labels and to pass text to them?

Read only

0 Likes
1,552

Hi Rahul,

What you need to do is as follows:

1 Create one main window with the exact format of the labels

2 call this window as many times as you want in the page (in sap script )

3 in the driver program

open_form

loop at itab.

pass your values to the variables for 1st sticker

write_form- MAIN Window

use the FM CONTROL_FORM

and pass the command NEW_WINDOW

endloop.

At each loop pass it will print a new sticker from left to right & when it reaches the end of the line it will go to the next row of stickers

VERY IMPORTANT

You may have to create a new PAGE FORMAT using the T-Code

SPAD (Spool Administration) for the exact alignment

Kindly be generous with points if you find the solution useful

Do let me know if you have further questions

Best Regards,

Gaurav

Read only

0 Likes
1,552

then creating lables like this wil not help us?

In the maintenance window, choose Edit ® Windows ® Create ® Labels.

The dialog window for editing a main window appears.

In the group box Area enter the left and the upper margins as well as the area width and hight of the individual labels.

In the group box Horizontal enter the horizontal distance between the labels and the number of labels.

In the group box Vertical enter the vertical distance between the labels and the number of labels.

In the group box Positions enter the starting position.

Read only

0 Likes
1,552

I am not saying it cant be dont that way

But in my work i have designed quite a few MRP labels / Barcode labels in the way i explained it to you.

the effort is minimum

you create only one main window , do all the formatting once ,

then import this window as many times as you want in the page

mind well even the variable name doesnt need to be changed

do a loop of what you want to print

once the sticker has been printed , move to the next sticker simply by using the NEW-WINDOW command

as i have used this method successfully in the past , that is y i recomended this.

I do not mean in anyway to say that the approach you are following will not work

Hope you understand what i am saying

Best regards,

Gaurav

Read only

0 Likes
1,552

I tried as u said.when i execute i get write_form invalid,start_form missing.

even after giving start_form and end_form it gives the same message.can u figure out why tht error is coming? i appreciate your help!

Read only

0 Likes
1,552

You need to use OPEN_FORM

before startin teh loop

withing the loop use

WRITE_FORM

CONTROL_FORM

one all loop passes are over CLOSE_FORM

Read only

0 Likes
1,552

CALL FUNCTION 'OPEN_FORM'

EXPORTING

FORM = 'Z_LABELS3'

LANGUAGE = SY-LANGU

loop at itab.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

TYPE = 'BODY'

WINDOW = 'MAIN'

CALL FUNCTION 'CONTROL_FORM'

EXPORTING

COMMAND = 'NEW-WINDOW'

endloop.

CALL FUNCTION 'CLOSE_FORM'

THIS IS WHT I DID AND I GET THE ERROR MESSAGE AS "WRITE_FORM is invalid, START_FORM is missing"

Read only

0 Likes
1,552

Try using START_FORM & END_FORM instead of OPEN_FORM & CLOSE_FORM

Read only

0 Likes
1,552

even tht doen't work..control_form has no effect..if possible can u paste the exact sample code .so tht iwud be useful for me.