on 02-24-2007 9:43 AM
Hi everybody,
I hope u enjoying great weekends!
Im getting confusion in the following concept,
can anybody sort it out for m
how to add a field to standard script?,I know we have to call a subroutine in form
editor,but could u pls provide me a detailed example .
waiting for reply,
thanks
Mr.Reddy
<b>Definition in the SAPscript form:</b>
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
<b>Coding of the calling ABAP program:</b>
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
READ TABLE IN_PAR WITH KEY PAGE.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY NEXTPAGE.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
READ TABLE OUT_PAR WITH KEY BARCODE.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = |. "First page
ELSE.
OUT_PAR-VALUE = ||. "Next page
ENDIF.
IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = L. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
<b>To know more about subroutine pool see below link</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
<b>In the textelement of sapscript i am calling subroutine GET_BARCODE present in program QCJPERFO and passing PAGE , NEXTPAGE as input parameters and Barcode as changing parameter (output)</b>
REPORT QCJPERFO.
FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA: PAGNUM LIKE SY-TABIX, "page number
NEXTPAGE LIKE SY-TABIX. "number of next page
<b>// Here in_par is table for input parameters is of type itcsy , so contains name and value as fields.
// 1st record of in_par in_par-name = PAGE in_par-value = the current page number
// (eq. 1 or 2 etc ... )
// 2nd record of in_par in_par-name = NEXTPAGE in_par-value = the Next page //number (eq. if page = 1 then next page = 2 etc ... )
// Here out_par is table for changing parameters ( output ) is of type itcsy .
// since i am passing only one changing parameter it contains only one record
// 1st record of out_par out_par-name = BARCODE out_par-value = ...(some value)
</b>
READ TABLE IN_PAR WITH KEY PAGE.
<b>// reading the records from in_par where field name is PAGE , so first record is selected from our table</b>
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.
<b>// Page number is stored in variable PAGNUM</b>
READ TABLE IN_PAR WITH KEY NEXTPAGE.
<b>// reading the records from in_par where field name is NEXTPAGE , so second record is selected from our table</b>
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.
<b>// Next Page number is stored in variable NEXTPAGE</b>
READ TABLE OUT_PAR WITH KEY BARCODE.
<b>// reading the records from out_par where field name is BARCODE , so first record is selected from our table</b>
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = |. "First page
<b>// if the variable PAGNUM value is one then i am storing | in OUT_PAR-VALUE ie, BARCODE</b>
ELSE.
OUT_PAR-VALUE = ||. "Next page
<b>// if the variable PAGNUM value is not one then i am storing || in OUT_PAR-VALUE ie, BARCODE</b>
ENDIF.
IF NEXTPAGE = 0.
<b>// if the variable NEXTPAGE value is Zero then i am storing L in OUT_PAR-VALUE ie, BARCODE</b>
OUT_PAR-VALUE+2 = L. "Flag: last page
ENDIF.
MODIFY OUT_PAR INDEX SY-TABIX.
<b>// After changing the field value of output table , i am modifying to reflect the changes.
// Now barcode contains the changed value ie, either | or || or L depending on the condition satified </b>
ENDFORM.
<b>That changed value i am printing in sapscript
/ &BARCODE&</b>
HI
Can anyone please tell me how to add a <b>PO number field</b> for the RVINVOICE01 form.this form already has <b>contract number, the order number and item number</b> So i need to add an extra field i.e <b>PO number field</b> in the same line.
Please give me a sample code for this. as i havent worked before on scripts.Very urgent. will be rewarded for this. my yahoo id is kumars_sap@yahoo.co.in
thanks.
rallabandi.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.