‎2007 Apr 27 3:17 PM
hi experts,
how can we add fields to script with out disturbing driver program.explaine me in brief.thanks in advance.
‎2007 Apr 27 3:27 PM
If those fields are already passed as variables or internal tables to the script, you can use them in the form. no need to change the driver program at all, if the changes are made in a text element which is called in the driver program using FM WRITE_FORM.
if u want to declare other local fields,
DEFINE &VBELN& = &VBDKR-VBELN&
DEFINE &SLSMN_SIGN& = &SPACE&
DEFINE &TXT_GRAPH& = 'T'
DEFINE &DPI& = '200'
PERFORM GET_SIGNATURE IN PROGRAM Z_SAPSCRIPT_INV
USING &VBELN&
CHANGING &SLSMN_SIGN&
CHANGING &TXT_GRAPH&
ENDPERFORM
now based on the return values of this 2 variables, u can code for whatever action u need them to perform.
in this case also, driver program is not touched. (you can write the sub routine (in my eg get_signature) in any program
‎2007 Apr 27 3:27 PM
If those fields are already passed as variables or internal tables to the script, you can use them in the form. no need to change the driver program at all, if the changes are made in a text element which is called in the driver program using FM WRITE_FORM.
if u want to declare other local fields,
DEFINE &VBELN& = &VBDKR-VBELN&
DEFINE &SLSMN_SIGN& = &SPACE&
DEFINE &TXT_GRAPH& = 'T'
DEFINE &DPI& = '200'
PERFORM GET_SIGNATURE IN PROGRAM Z_SAPSCRIPT_INV
USING &VBELN&
CHANGING &SLSMN_SIGN&
CHANGING &TXT_GRAPH&
ENDPERFORM
now based on the return values of this 2 variables, u can code for whatever action u need them to perform.
in this case also, driver program is not touched. (you can write the sub routine (in my eg get_signature) in any program
‎2007 Apr 27 3:31 PM
HEllo,
You can do in the form itself.
Just check this
write these lines in your script.
/: DEFINE &AB& TYPE I,
/: &GV&
/: &AB& = 1
/: PERFORM INCR_NUM IN PROGRAM ZTESTPDF
/: USING &AB&
/: CHANGING &GV&
/: TABLES INPUT_TABLE
/: OUTPUT_TABLE
/: ENDPERFORM
" CHeck here
Sample code which is similar to your requirement
Write the following lines of code in your driver program(ZTESTPDF)
FORM INCR_NUM TABLES INTAB STRUCTURE ITCSY
OUTAB STRUCTURE ITCSY.
DATA: V_DATE LIKE SY-DATUM , V_CHAR(10) TYPE C.
READ TABLE OUTAB WITH KEY NAME = 'GV'.
IF SY-SUBRC = 0.
V_DATE = SY-DATUM + 1.
CONCATENATE V_DATE+4(2) V_DATE+6(2) V_DATE+0(4) INTO V_CHAR
SEPARATED BY '.'.
OUTAB-VALUE = V_CHAR.
CONDENSE OUTAB-VALUE.
MODIFY OUTAB INDEX SY-TABIX.
ENDIF.
ENDFORM.
If useful reward.
Vasanth
‎2007 Apr 27 3:31 PM
Hello surendra,
to add a field to SAPScript just enter the field name
in any of he windows as &itab-<f>&
to add a logo..
first upload your logo using the tcode se78.
then in se71, select the window to add logo.
goto edit -> text elements.
goto->change editor.
insert -> graphic.
enter the name of the logo.
-
Check out the code below:-
/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/ &BARCODE&
Coding of the calling ABAP program:
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>Reward points if helpful :-)</b>
Thanks,
Sachin