cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript problem

milascon_daniel
Participant
0 Kudos

Hi,

I have creted a simple sapscript example which contains 3 windows: main, data and header. Data window displays current date, header some information like address,etc and in main I have declared an element called MAIN_ELEMENT and 4 lines:

- &USR02-BNAME&

- &USR02-ANAME&

- &USR02-ERDAT&

- &USR02-LOCNT&

I want to output that columns (BNAME,ANAME,ERDAT,LOCNT) from USR02 table. How to do that??

Please someone help me.

Thank you!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

after creating the layout, u create a driver program in se38.

1.create an internal table with those 4 fields.

2.write a select statement to fetch the data into the internal table.

3. call open_form function module. for this pass the form name i.e, ur script name. also pass the language as 'en'.

4.call write_form function module. for this pass the window name i.e, main. n also pass the text element name i.e element parameter, give ur text element name (main_element),

5.call the close_form function module. no need to pass any parameters for thid.

write all in upper case while passing to function module.

hope this help u.

reward if helpful.

Former Member
0 Kudos

Thanks for the valuble info,I too needed this one.

Former Member
0 Kudos

Hi,

Do the following :

1. Create a driver program. Inside it assign values to

- &USR02-BNAME&

- &USR02-ANAME&

- &USR02-ERDAT&

- &USR02-LOCNT&

based on the number of records. Run a loop if there are more than 1 records and fill the table USR02. Now call open_form function module and then write_form function module. pass the parameters in write_form :

Window - name of the window where u want to display these records, in your case main window.

Text Element - name of your text element MAIN_ELEMENT

now call close_form.

2. Get the configuration done between your script and the program, depending on the module u r working in. It may be done in NACE or SPRO or may be some other transaction.

Reply if this info is useful for you..

All the best!

Navita

Former Member
0 Kudos

Hi,

1.write a driver program for those values.

2.Call this layout in that.

3.OR write form routine and call it in layout using ITCSY.

4.But, In this situation you need to write the driver program with selecting all fields ,which u are mentioned from usr02.

just see this:

for SAPscripts

For follg., refer http://www.henrikfrank.dk/abapuk.html

Regards,

Kumar(Reward if helpful).

milascon_daniel
Participant
0 Kudos

that link is not working...