cancel
Showing results for 
Search instead for 
Did you mean: 

regarding SAP Scripts

Former Member
0 Kudos

Hi All,

thanks for usefull reply.I hav naother problem i.e ,i want to print data in tabular form(items).But when ever same value conatin more than one value,at that time the decreptions

( TEXT ) of the fiels also repeating and giving like ,

example.

mat1,mat2,mat3,mat4...........mat10.

10, x y z ...................a

mat1 mat2 mat3 ..........mat10

20 x1 y1 z1 ...........a1.

But I want like this ,

mat1 mat2 mat3 mat4............mat10

10 x y z .................a

20 x1 y1 z1 ...................a1

thanks and regards,

venkat.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kaarthikeyan,

I am Venki , thanks for reply .But I am modifying standard script by using subroutine pool program.So in my program It

is not possible to use call functions.So plz let me know any other procedure is avialble for that.

regards,

venki.

Former Member
0 Kudos

Hi Venki,

Anyway your driver program for sure will call the WRITE_FORM Function module. So use that element in your SAP script to solve your problem.

In case if its a standard driver program, sometimes they must not have used write_form for the description(MAT1 MAt2 ....MAT10). In that case give in the main window as shown below:

IN Main Window:

MAT1 MAT2 MAT3 MAT10

/E ITEMS

&wa_vbap-f1& &wa_vbap-f2& &wa_vbap-f3&

If its a custom print program, do as i said in the previous message.

Please REWARD Points if useful.

Thanks,

karthik

Former Member
0 Kudos

Hi Venki,

Proceed the way i have given below:

1) Give the Open_Form Function Module to open the SAP Script.

2) To Print the desciption (i.e) i mean Mat1 Mat2 Mat3 Mat10, Give the corresponding Write_form.

In SE38

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'HEAD'

window = 'MAIN'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

.

3) Correspondingly in the SAP Script, in the Main window follow the below code:

/E HEAD

  • MAT1 MAT2 MAT3......MAT10

4) Then in the SE38, Loop at the items internal table say IT_VBAP and use the WRITE_FORM between the LOOP ENDLOOP.

LOOP AT it_vbap INTO wa_vbap.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ITEM'

window = 'MAIN'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

.

ENDLOOP.

5) Accordingly in the SAP SCRIPT, in the Main window

/E ITEM

  • &wa_vbap-f1& &wa_vbap-f2& &wa_vbap-f3&...

Here what happens is for the WRITE_FORM ( for HEAD Element) function module which we call to print description will be called once and WRITE_FORM (for ITEMS Element)Function module will be called till the records in the internal table are printed.

so final result will be like

MAT1 MAT2 MAT10

10 a1 a9

20 b1 b9

Please REWARD points if useful.

Thanks,

karthik