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

changes in print program RFKORD10

Former Member
0 Likes
1,317

Hi

This is very urgent.

TCODE: F.64

My requirement is "Display customer invoice for one document number(invoice number). In main window of layout i need to display line items from BSEG table for this document number.

As per standard print program RFKORD10 , this is displaying according to BSID table.but i need to display amount and tax amount according to BSEG Table.

I need to change the print program RFKORD10 to diplaly line items from BSEG.

suppose BSID will have one record with this document number 160000.

For this document number BSEG will have number of records.

belnr -160000 amount -50

belnr -160000 amount -100

belnr -160000 amount -200

how can i loop BSEG in copied print program?

I copied layout F140_ACC_STAT_03 to ZF140_ACC_STAT_03 , to display above line items from BSEG, there is no text element available.

how can i create new text element to display BSEG Line items?

points will be rewards

please reply with solution.

3 REPLIES 3
Read only

Former Member
0 Likes
682

Hi Neelima,

Normally all data in Script are output in the Layout in Function Module 'WRITE_FORM'.

Hence what you need to do is that ..U need to check in the print program whether it fetching data from BSEG...Coresspoding to the entry in BSID.

If you are aware, U can create a text element in script in the Main WIndow and write a subpool program which fetches data from BSEG and Output the same in the Layout...

Hope this helps you..

Thanx,

Navin..:)

Read only

0 Likes
682

i copied standard program RFKORI93 to ZRFKORI93.

Please let me know where i need to add the logic in this program to print all records from BSEG.

Read only

Former Member
0 Likes
682

Hi,

It would be better to change the script than to change the STD Program

You can use Perform statement in the script to call an subroutine in a program to fetch necessary values.

Sample Code in script:

Perform ZCALC in Program ZDRIVER

Using <var1>,

Using <var2>,

Changing <var3>,

Changing <var4>,

Changing <var5>,

EndPerform.

Var1 & 2 are the values you might require to fetch data from BSEG like Doc NO, Date Etc..

Var 3,4&5 are the data you wanna populate onto your scripts Like Net Amt, Ref doc no, Etc..

In the Subroutine program Define the import parameters with structure ITCSY.

The structure contains Name of a Variable and value.

Sample Code in Program,

REPORT DRIVER.

FORM ZCALC TABLES INPUT STRUCTURE ITCSY

OUTPUT STRUCTURE ITCSY.

READ TABLE INPUT WITH KEY 'J_1IMOCUST-KUNNR'.

VALUE = INPUT-VALUE.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = VALUE

IMPORTING

OUTPUT = VALUE.

SELECT SINGLE J_1IEXCD into ECC from J_1IMOCUST where KUNNR = VALUE.

ECC = ECC.

READ TABLE OUTPUT INDEX 1.

MOVE ECC TO OUTPUT-VALUE.

SHIFT OUTPUT-VALUE LEFT DELETING LEADING SPACE.

MODIFY OUTPUT INDEX 1.

SELECT SINGLE J_1ILSTNO INTO LST FROM J_1IMOCUST WHERE KUNNR = VALUE.

LST = LST.

READ TABLE OUTPUT INDEX 2.

MOVE LST TO OUTPUT-VALUE.

SHIFT OUTPUT-VALUE LEFT DELETING LEADING SPACE.

MODIFY OUTPUT INDEX 2.

SELECT SINGLE J_1ICSTNO INTO CST FROM J_1IMOCUST WHERE KUNNR = VALUE.

CST = CST.

READ TABLE OUTPUT INDEX 3.

MOVE CST TO OUTPUT-VALUE.

SHIFT OUTPUT-VALUE LEFT DELETING LEADING SPACE.

MODIFY OUTPUT INDEX 3.

SELECT SINGLE J_1IEXRG INTO RANGE FROM J_1IMOCUST WHERE KUNNR = VALUE.

RANGE = RANGE.

READ TABLE OUTPUT INDEX 4.

MOVE RANGE TO OUTPUT-VALUE.

SHIFT OUTPUT-VALUE LEFT DELETING LEADING SPACE.

MODIFY OUTPUT INDEX 4.

SELECT SINGLE J_1IEXDI INTO DIV FROM J_1IMOCUST WHERE KUNNR = VALUE.

DIV = DIV.

READ TABLE OUTPUT INDEX 5.

MOVE DIV TO OUTPUT-VALUE.

SHIFT OUTPUT-VALUE LEFT DELETING LEADING SPACE.

MODIFY OUTPUT INDEX 5.

endform. "ZSOLD

The table in the form is already looped in the driver program. SO each time the loop runs this subroutine will be called. fetching data each time according to our selection criteria.

Regards

Vijay

Edited by: Vijay on Jul 2, 2008 7:32 AM

Edited by: Vijay on Jul 2, 2008 7:36 AM