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

Line Item in SapScripts

Former Member
0 Likes
2,103

Hello Experts,

I'm trying to printing customer invoice line item in a form. But it is only printing 1st line of the line item.

I'm trying to print all documents of the table BSEG.

Please advice if I need any coding in SAP scripts.

If I need any ABAP coding then please let me know where I should write it.

My SAPscript code looks like:

code]

/E 20 520

/* - Line items heading -


[

T1: &BKPF-BLDAT&,,&BSEG-BELNR&,,&BSEG-SGTXT& ,,,,&BSEG-WRBTR&

T1: ,,&RF140-VTEXT',,&RF140-MSATZ&%,,,,&RF140-MWSHB&'&

T1: ,,,,,,,,&uline(20)&

T1: ,,,,,,,,&RF140-GSALDF&

[/code]

Thanks

Hello Experts,

I'm trying to printing customer invoice line item in a form. But it is only printing 1st line of the line item.

I'm trying to print all documents of the table BSEG.

Please advice if I need any coding in SAP scripts.

If I need any ABAP coding then please let me know where I should write it.

My SAPscript code looks like:

code]

/E 20 520

/* - Line items heading -


[

T1: &BKPF-BLDAT&,,&BSEG-BELNR&,,&BSEG-SGTXT& ,,,,&BSEG-WRBTR&

T1: ,,&RF140-VTEXT',,&RF140-MSATZ&%,,,,&RF140-MWSHB&'&

T1: ,,,,,,,,&uline(20)&

T1: ,,,,,,,,&RF140-GSALDF&

[/code]

Thanks

9 REPLIES 9
Read only

Former Member
0 Likes
1,530

Hi Nazmul ,

Are you using the standrad driver program .

If yes please debug the script and see how may times is the element used to print the item details called.

To Activate debugging (SE71-->Utilities -->Activate Debugging)

Regards

Arun

Read only

0 Likes
1,530

Hi Arun,

1st I would like to inform you that I'm new to ABAP.

When I run the program by turning on the debug it starts with program RFKORB00.

I'm generating the document by

1. txn f.62.

2. Get variant ... and choose CUST INV

3. And then execute.

So yes it is standard driver program. Do I need to write my own driver program to loop through the BSEG table or the standard program should loop through the table and display in the form. As I've declared the table fields name in the line item section?

Please advice.

Read only

0 Likes
1,530

Hi Nazmul ,

I am not clear with what changes you have made (i am referring to the last line).

Have you tried one entire cycle of debugging , please try doing it , it will be of help to you .

Reagrds

Arun

Read only

0 Likes
1,530

Hi Arun,

I have copied the form F140_DOCU_EXC_02 to /FJANZLG/YINVOIC and now trying to display &BKPF-BLDAT&,,&BSEG-BELNR&,,&BSEG-SGTXT& ,,,,&BSEG-WRBTR& in line item section.

How do I do that. It is displaying ony 1 line item even though the BSEG table contains 5 lines.

Thanks a lot for your prompt answer.

Naz

Read only

0 Likes
1,530

Hi Nazmul ,

There values are already there in the text element 521 of the standard form.

What all changes have you made in your custom form.

Please also test using the standrad form and see what is its output , does it show all the 5 line items

Reagrds

Arun

Read only

0 Likes
1,530

Hi Arun,

I have only modified the table fields.

The Main window of standard form F140_DOCU_EXC_02 displaying field from tables BSEG, BKPF, RF140, RF140 and has the following code:

[code]

/E 520

/* - Line items heading -


AS

UL &uline(71)&

T1 <k>Doc.No.,,,,Date</>

UL &uline(71)&

/E 521

/* - Line items heading -


T1 &BSEG-BELNR&,,,,&BKPF-BLDAT&,,&RF140-WAERS&,,&RF140-WRSHB&

T1 ,,&BSEG-SGTXT&

T1 &RF140-VTEXT',,&RF140-MSATZ&%,,,,&RF140-WAERS&,,&RF140-MWSHB&'&

T1 ,,,,,,,,&uline(20)&

T1 Brutto,,,,,,&RF140-WAERS&,,&RF140-GSALDF&

[/code]

And the custom form has the following code:

-


[code]

/E 520

/* - Line items heading -


AS

UL &uline(71)&

T1 <k>Date,,Invoice. No.,,Text,,,,Amount (NZ$)</>

UL &uline(71)&

/E 521

/* - Line items heading -


T1 &BKPF-BLDAT&,,&BSEG-BELNR&,,&BSEG-SGTXT& ,,,,&BSEG-WRBTR&

T1 ,,&RF140-VTEXT',,&RF140-MSATZ&%,,,,&RF140-MWSHB&'&

T1 ,,,,,,,,&uline(20)&

T1 ,,,,,,,,&RF140-GSALDF&[

[/code]

Read only

Former Member
0 Likes
1,530

Hi,

Check if you have looped your text element in the driver program.

Regards,

pankaj singh

Read only

Former Member
0 Likes
1,530

Nazmul

call the looped item in main window only. In a main windom, assign a element and the same has been called in ur code after loop statement.

It will work

Read only

0 Likes
1,530

Did you mean the data item as loop item? Which code are you talking about?

Can please provide some example?

Thanks a lot in advance.