cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Script new field addition

Former Member
0 Kudos

Hi all,

I have a requirement that in my output type rd00, i have to add country related invoice number at the item level.and also add the invoice number value too.

so I need what the code shuld be written to put the invoice number at item level and how to pass the invoice number values to the form again.

Thanks,

karan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Karan,

If you are asking how you will add a new field to the output..

You will add the field in the MAIN window, and in the text element where your item lines are getting printed.

Find that line which is printing the line items.. It will be a long sequence of fields separated by ",,".

Add the new field as &newfield&,, whereever u want. You will need to adjust the tab positions of the paragraph after doing this..

Thanks and Best Regards,

Vikas Bittera.

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Former Member
0 Kudos

HI,

Call a subroutine in the script and get the invoice number.

follow these..

Syntax goes like this

/: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM

INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.

OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.

Example:

In script form

/: PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'

/: USING &EKKO-EKORG&

/: USING &EKPO-WERKS&

/: USING &EKKO-EKGRP&

/: USING &EKKO-BSTYP&

/: CHANGING &COMPNAME&

/: CHANGING &SENDADR&

/: CHANGING &INVCADR&

/: CHANGING &COMPADR&

/: CHANGING &COVERLTR&

/: CHANGING &SHIPADR&

/: CHANGING &REMINDER&

/: CHANGING &REJECTION&

/: CHANGING &POSTADR&

/: CHANGING &LOGO&

/: ENDPERFORM

In program

----


  • FORM Read_texts - To extract the standard texts from the table *

----


FORM READ_TEXTS TABLES IN_PAR STRUCTURE ITCSY

OUT_PAR STRUCTURE ITCSY.

DATA : L_EKORG TYPE EKORG,

L_WERKS TYPE WERKS_D,

L_BSTYP TYPE BSTYP,

L_EKGRP TYPE BKGRP.

READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .

CHECK SY-SUBRC = 0.

L_EKORG = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .

CHECK SY-SUBRC = 0.

L_WERKS = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .

CHECK SY-SUBRC = 0.

L_EKGRP = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .

CHECK SY-SUBRC = 0.

L_BSTYP = IN_PAR-VALUE.

CLEAR Z08M1_ORG_TEXTS.

SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG

AND WERKS = L_WERKS

AND EKGRP = L_EKGRP

AND BSTYP = L_BSTYP.

IF SY-SUBRC NE 0.

SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG

AND WERKS = L_WERKS

AND EKGRP = L_EKGRP

AND BSTYP = SPACE.

ENDIF.

READ TABLE OUT_PAR WITH KEY 'COMPNAME'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'SENDADR'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'INVCADR'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'COMPADR'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'COVERLTR'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'SHIPADR'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'REMINDER'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'REJECTION'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'POSTADR'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.

MODIFY OUT_PAR INDEX SY-TABIX.

READ TABLE OUT_PAR WITH KEY 'LOGO'.

OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.

Former Member
0 Kudos

Thnaks for ur reply.

But using perform endperform how to insert a new field like invoice number.

plzz give some steps.

Regards,

Karan

Former Member
0 Kudos

HI,

you already have window in the script in that you are already printing the line items. go the the specific element of the window where line items are getting printed.. at that place just call this subroutine and get the invoice number... and one doubt.. are you not printing this invoice number any where else in the form. if you are printing then just give that filed in the item window &inoice-nubmer&.. and that should be done.. if you dont have this invoice number.. then you have to call the suroutine and pass some value and in the subroutine select the required invoice number.

Thanks

Mahesh