Sapscript- display
Hello Experts,
I have sapscript ZMEDRUCK01, while debugging data is
coming but the data is not getting displayed in Print preview.
Please suggests.
Regards.
Hi,
if you want to check why in the preview data is not displaying ,activate the debugger in se71 and go to relevent transaction,say me23n go for print preview it will go to debugger mode of the script.
ot if it is a program activate debugger in se71 and then go and activate the program through which u can trace the reason behind not getting the preview,
reward if usefull
MNGowda
Similar Messages
-
Sapscript - displaying two text fields after truncating the spaces.
Hi Friends,
In a sapscript, I have to display the name of the vendor which is in two different fields each of length 40 chars. The first one may be filled to the maximum and the remaining goes into the second field and may occupy only 30 or 35 chars. I need to display the two side by side and the space available is 70 chars. I am using an existing script and I am not able to print the two side by side. It is going to the next line. How do I truncate the trailing spaces of either field. Please help. It is quite urgent.
Thanks,
BP.Hi Bindu,
use the perform to concatenate name1 and name2 to NAME and use this field in address command.
Check with the following code:
/: DEFINE &ZNAME& = ''
PERFORM ADDRESS IN PROGRAM 'PROGRAM'
USING ®UH-ZNME1&
USING ®UH-ZNME2&
CHANGING &ZNAME&
ENDPERFORM
FORM address
TABLES itab STRUCTURE itcsy
otab STRUCTURE itcsy.
LOOP AT itab.
CASE itab-name.
WHEN 'REGUH-ZNME1'.
l_name1 = itab-value.
WHEN 'REGUH-ZNME2'.
l_name2 = itab-value.
ENDCASE.
ENDLOOP.
use the logic.
Endform. -
Hi all,
I have a number displayed on form as 3 decimals and want to display this number as 2 decimals only.
How can I do that?
Thanks.
deniz.Ok.. I got to raise this
think the value is 218.509
525.589
528.893
total : 1272.991.
and we show 218.50
525.58
528.89
total: 1272.97 -
Hi all,
I have a form with one Window -> Main Window, in this Window it will be written many different information... there is also a table, when the table cause a new-page, the header (discription of the table) should be written (repeated) also on the new page.
Im trying to find out, how i can get the page number in the print-programm... but I dont found any variable (print_co-actpage doesnt work)
Thanks a lot for your help.Hi David,
I'm sure you've got around your requirement by now, but for future reference you can get the page number into your print program by calling the function module 'GET_TEXTSYMBOL'.
data: lv_page(255) type c.
lv_page = '&PAGE&'.
call function 'GET_TEXTSYMBOL'
exporting line = lv_page
start_offset = 0
importing value = lv_page.
Cheers,
Darren -
Hello experts,
I am execute pc00_m40_f16 and after list display when i click on print form and then on print preview button i am not able to display print preview. If i only click on customer layout then preview will display but it is a smart form or sapscript display i want to display it in PDF. Is there any setting regarding this.
Thanks in advance
UnmeshHello Unmesh
For PDF display and print preview ,you need to have ADS configured.
having done this ,Please implement the Note 1447617 to resolve the issue. Please implement
the correction instructions attached with the Note.
Also, please note that the note involves changes in Job profile change
in the ADS server
1 Preparation for JobProfile on ADS server
Refer to SAP note 886572. This note has section for 'JobProfile'.
Follow steps in this note.
2. Copy JobProfile xml file to ADS server
Download attached Remove_Annote.zip and extract.
Copy Remove_Annote.xml file to ADS server
/usr/sap/<SID>/SYS/global/AdobeDocumentServices/JobProfiles/Custom/print
Thanks and Kind Regards
Ramana -
How i can add document nu in below query
i want to add one field in below query
field is bkpf-xblnr
i want document number after d_text.
here d_text = 'Payment for'
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_TEXT'.
tab_out-value = d_text.
MODIFY tab_out INDEX sy-tabix.
please help
thanks in advanced.hi help yar i m totaly new for this
i m pasting whole code here just see yar and where u changing please hight light that things
thanks yar
PROGRAM zfisp0001.
*& Subroutine pool ZFISP0001 *
*& Author: Rakesh Rao on 01.04.05 *
*& Modified by: Rakesh Rao on 15.07.2005 *
*& Description: This subroutine pool is called from Check and Payment *
*& Advice SAPScripts *
TABLES: itcsy.
TYPES: BEGIN OF t_itcsy.
INCLUDE STRUCTURE itcsy.
TYPES: END OF t_itcsy.
DATA: tab_in TYPE STANDARD TABLE OF t_itcsy WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 0.
DATA: tab_out TYPE STANDARD TABLE OF t_itcsy WITH NON-UNIQUE
DEFAULT KEY INITIAL SIZE 0.
DATA: d_count(3) VALUE 0,
d_netamt_tot TYPE p DECIMALS 2,
d_tdsamt_tot TYPE p DECIMALS 2,
d_grossamt_tot TYPE p DECIMALS 2,
d_tdsamt TYPE p DECIMALS 2.
DATA flag.
DATA: bschl LIKE bseg-bschl.
DATA: shkzg LIKE bseg-shkzg.
clear: d_count,d_netamt_tot.
*& Form ZPAYMENT
text
--> p1 text
<-- p2 text
FORM zpayment TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
tables : bsak.
TYPES: imis_type_c20(20) TYPE c,
imis_type_c10(10) TYPE c.
DATA: l_intern TYPE imis_type_c20.
DATA: e_intern TYPE imis_type_c10.
DATA: i_extern TYPE imis_type_c10.
DATA: d_belnr(10),
D_VBLNR(10),
d_bukrs TYPE bseg-bukrs,
d_gjahr TYPE bseg-gjahr,
d_gjahr1 TYPE bseg-gjahr, " 15.07.2005 Rakesh
d_buzei TYPE bseg-buzei,
d_augbl TYPE bseg-augbl,
d_umskz TYPE bseg-umskz,
d_bschl TYPE bseg-bschl,
d_bktxt TYPE bkpf-bktxt,
d_budat(10),
d_rebzg TYPE bseg-rebzg,
D_SHKZG TYPE REGUP-SHKZG,
d_swnes TYPE regud-swnes,
d_netamt TYPE p DECIMALS 2,
d_tdsamt TYPE p DECIMALS 2,
d_discamt TYPE regud-wskto,
d_gross TYPE regud-wrbtr.
DATA: BEGIN OF t_bkpf,
bukrs TYPE bkpf-bukrs,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
budat TYPE bkpf-budat,
bktxt TYPE bkpf-bktxt,
xblnr TYPE bkpf-xblnr,
END OF t_bkpf.
DATA: BEGIN OF t_bseg,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
buzei TYPE bseg-buzei,
umskz TYPE bseg-umskz,
bschl TYPE bseg-bschl,
qbshb TYPE bseg-qbshb,
augbl TYPE bseg-augbl,
rebzg TYPE bseg-rebzg,
rebzj TYPE bseg-rebzj,
sgtxt TYPE bseg-sgtxt,
xref1 TYPE bseg-xref1,
ebeln TYPE bseg-ebeln,
shkzg type bseg-shkzg,
END OF t_bseg.
DATA: num VALUE ' ',
d_result VALUE ' '.
DATA: d_symbol VALUE '/',
d_text(11) VALUE 'Payment for'.
DATA: d_belnr1 LIKE bseg-belnr.
DATA: wa_payrq TYPE payrq. " 15.07.2005 Rakesh
18.05.2006
data : wa_belnr like bseg-belnr,wa_augbl like bseg-augbl.
18.05.2006
06.09.2006
data : d_other type p decimals 2.
Read incoming data
*break-point.
*zpayment.
CLEAR: d_belnr,d_bukrs,d_gjahr,d_result.
clear d_tdsamt.
Company code
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BUKRS'.
d_bukrs = tab_in-value.
Document number
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BELNR'.
wa_belnr = d_belnr(10) = tab_in-value(10).
Posting Key
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BSCHL'.
d_bschl = tab_in-value.
Special G/L Indicator
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-UMSKZ'.
d_umskz = tab_in-value.
Fiscal year
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-GJAHR'.
d_gjahr = tab_in-value.
<-- 15.07.2005 Rakesh
Fiscal year1 - For Payment request case
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-GJAHR'.
d_gjahr1 = tab_in-value.
15.07.2005 Rakesh -->
Document item
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BUZEI'.
d_buzei = tab_in-value.
Discount amount, if any
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-WSKTO'.
REPLACE ALL OCCURRENCES OF ',' IN tab_in-value WITH ' '.
d_discamt = tab_in-value.
Gross Amount
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-WRBTR'.
REPLACE ALL OCCURRENCES OF ',' IN tab_in-value WITH ' '.
d_gross = tab_in-value.
Gross Amount
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-WNETT'.
REPLACE ALL OCCURRENCES OF ',' IN tab_in-value WITH ' '.
d_netamt = tab_in-value.
Clearing document 18.05.2006
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
wa_augbl = tab_in-value.
DEBIT/CREDIT INDICATOR
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-SHKZG'.
d_SHKZG = tab_in-value(1).
IF d_netamt < 0 AND D_SHKZG = 'S'.
D_NETAMT = D_NETAMT * '-1'.
ENDIF.
Check document no. is clearing document than reset wnett = 0.
18.05.2006
select single * from bsak where augbl = wa_augbl
and bukrs = d_bukrs and gjahr = d_gjahr1.
if sy-subrc = 0 and wa_belnr = wa_augbl.
d_netamt = 0.
endif.
18.05.2006
Check if Down payment request
IF d_bschl = '39'.
This line item is not considered
d_result = 'X'.
ELSE.
Check if Down payment
IF d_bschl = '29'
and wa_augbl = wa_belnr. "18.05.2006
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
Put Document Number of the Payment Document value to 'd_belnr'
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
ENDIF.
ENDIF.
<--15.07.2005 Rakesh
Check if Payment request exists in 'payrq'
CLEAR wa_payrq.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
d_belnr1 = d_belnr.
CLEAR d_belnr.
d_belnr = e_intern.
SELECT SINGLE keyno augbl FROM payrq
INTO CORRESPONDING FIELDS OF wa_payrq
WHERE keyno = d_belnr.
IF sy-subrc = 0. " Yes
Take clearing document which is the required accounting document
d_belnr = wa_payrq-augbl.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
Assign 'd_gjahr1' to 'd_gjahr' as this is relevant here.
d_gjahr = d_gjahr1. " 15.07.2005 Rakesh
Get BSEG data
SELECT SINGLE bukrs belnr gjahr buzei augbl rebzg rebzj
sgtxt qbshb umskz bschl xref1 ebeln
FROM bseg INTO CORRESPONDING FIELDS OF t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr
AND buzei EQ d_buzei " not relevant
AND bschl EQ '25' " Posting key - Outgoing payment
AND koart EQ 'S' " G/L accounts
AND shkzg EQ 'S'. " Debit
ELSE. " No
For all other cases, we use this final logic, even though we have
taken d_belnr value from accounting doc no., in some earlier cases.
Put document number of the payment document(vblnr) value to 'd_belnr',
IF d_bschl = '29'
and wa_augbl <> wa_belnr. "18.05.2006
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
else.
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
endif.
else.
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
endif.
-->15.07.2005
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
Get BSEG data
SELECT SINGLE bukrs belnr gjahr buzei augbl rebzg rebzj
sgtxt qbshb umskz bschl xref1 ebeln shkzg
FROM bseg INTO CORRESPONDING FIELDS OF t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr1
"changed by Bharat 15.04.2006 - d_gjahr1 contains payment doc fiscal yea
"r and d_gjahr contains invoice fiscal year
AND buzei EQ d_buzei "amisha 10-10-2005
AND bschl EQ '25' " Posting key - Outgoing payment
AND shkzg EQ 'S' "added by Bharat 17.04.2006
AND ( koart EQ 'K' OR koart EQ 'D').
<--15.07.2005 Rakesh
18.05.2006
in clearing document payment advice not consider TDS amount of
payment document
if wa_belnr <> wa_augbl and d_shkzg = 'S'.
t_bseg-qbshb = t_bseg-qbshb * '-1'.
d_netamt = d_netamt + t_bseg-qbshb.
t_bseg-qbshb = 0.
endif.
18.05.2006
ENDIF.
-->15.07.2005
Get corresponding BKPF data
If Down payment
IF d_bschl = '29'.
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
SELECT SINGLE bukrs belnr gjahr budat bktxt xblnr
FROM bkpf INTO CORRESPONDING FIELDS OF t_bkpf
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr1.
"changed by Bharat 15.04.2006 - d_gjahr1 contains payment doc fiscal yea
"r and d_gjahr contains invoice fiscal year
ENDIF.
ELSE.
If Partial payment/On-account payment
IF t_bseg-augbl IS INITIAL.
On-Account case
IF t_bseg-augbl IS INITIAL.
IF t_bseg-rebzg IS INITIAL.
t_bseg-rebzg = t_bseg-belnr. " Payment Document Number
t_bseg-rebzj = t_bseg-gjahr. " Fiscal year
ENDIF.
ENDIF.
SELECT SINGLE bukrs belnr gjahr budat bktxt xblnr
FROM bkpf INTO CORRESPONDING FIELDS OF t_bkpf
WHERE bukrs EQ t_bseg-bukrs
AND belnr EQ t_bseg-rebzg
AND gjahr EQ t_bseg-rebzj.
ELSE.
FULL PAYMENT with Discount
clear d_tdsamt.
Following code added for GSPL by bharat06092006
if d_bukrs eq 'GSPL'.
DATA : V_TEXT(20) TYPE C.
V_TEXT = 'W%'.
SELECT SINGLE wrbtr FROM bseg
INTO d_tdsamt
WHERE bukrs EQ d_bukrs AND
belnr EQ d_belnr1 AND
gjahr EQ d_gjahr AND " Added by bharat on 10-04-2006 fiscal year
bschl EQ '50' AND
KTOSL EQ 'WIT' AND
QSSKZ NOT LIKE V_TEXT.
SELECT single wrbtr FROM bseg
INTO d_other
WHERE bukrs EQ d_bukrs AND
belnr EQ d_belnr1 AND
gjahr EQ d_gjahr AND " Added by bharat on 10-04-2006 fiscal year
bschl EQ '50' AND
KTOSL EQ 'WIT' AND
QSSKZ LIKE V_TEXT.
ELSE.
Added by bharat 06.09.2006
SELECT SINGLE wrbtr
FROM bseg INTO d_tdsamt
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr1
AND gjahr EQ d_gjahr
" Added by bharat on 10-04-2006 fiscal year
AND bschl EQ '50' AND KTOSL EQ 'WIT'.
ENDIF.
SELECT SINGLE bukrs belnr gjahr budat bktxt xblnr
FROM bkpf INTO CORRESPONDING FIELDS OF t_bkpf
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr1.
"changed by Bharat 15.04.2006 - d_gjahr1 contains payment doc fiscal yea
"r and d_gjahr contains invoice fiscal year
tab_in-value
*d_tdsamt_tot
ENDIF.
ENDIF.
IF sy-subrc = 0.
Sr. no. for Line items
d_count = d_count + 1.
ELSE.
Else, this line item is not considered
d_result = 'X'.
ENDIF.
ENDIF. " if d_bschl = '39'
Pass the output to the outgoing table 'tab_out', if 'd_result' is not
*set.
IF d_result = ' '.
Line count
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'COUNT'.
tab_out-value = d_count.
MODIFY tab_out INDEX sy-tabix.
Result flag
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'RESULT1'.
tab_out-value = d_result.
MODIFY tab_out INDEX sy-tabix.
Clearing document
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'AUGBL'.
tab_out-value = t_bseg-augbl.
MODIFY tab_out INDEX sy-tabix.
IF d_bschl <> '29'.
On-Account case
IF t_bseg-augbl IS INITIAL.
IF t_bseg-rebzg IS INITIAL.
t_bseg-rebzg = t_bseg-belnr. " Payment Document Number
ENDIF.
ENDIF.
ELSE.
Payment document request
IF NOT t_bseg-ebeln IS INITIAL. " First preference
t_bseg-rebzg = t_bseg-ebeln.
ELSE.
t_bseg-rebzg = d_belnr.
ENDIF.
ENDIF.
Number of the Invoice the Transaction Belongs to
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'REBZG'.
SHIFT t_bseg-rebzg LEFT DELETING LEADING num.
tab_out-value = t_bseg-rebzg.
MODIFY tab_out INDEX sy-tabix.
Document number - check use??
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'BELNR'.
tab_out-value = d_belnr. " check!!
MODIFY tab_out INDEX sy-tabix.
Net amount
d_netamt = d_gross - d_discamt - t_bseg-qbshb.
Gross amount
d_gross = d_netamt + d_tdsamt + t_bseg-qbshb.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'NETAMT'.
tab_out-value = d_netamt.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
TDS Amount
IF t_bseg-qbshb IS INITIAL.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'TDSAMT'.
tab_out-value = d_tdsamt.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
Added by bharat 06.09.2006
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_OTHER'.
tab_out-value = d_other.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
Added by bharat 06.09.2006
ELSE.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'TDSAMT'.
tab_out-value = t_bseg-qbshb.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
ENDIF.
*Calculate Total Net amount & TDS amount which is stored in Global
*memory and accessed later
from 'FORM Z_TOTAL_AMT'
d_netamt_tot = d_netamt_tot + d_netamt.
d_grossamt_tot = d_grossamt_tot + d_gross.
d_tdsamt_tot = d_tdsamt_tot + t_bseg-qbshb + d_tdsamt + d_other.
CLEAR: tab_OUT-value,tab_out-name.
READ TABLE tab_OUT WITH KEY 'NETAMT_TOT'.
tab_out-value = d_netamt_tot.
shift tab_out-value left deleting leading space.
MODIFY tab_out INDEX sy-tabix.
Document Header text
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'BKTXT'.
IF d_bschl = '29'.
tab_out-value = t_bseg-sgtxt. " for down payment request
ELSE.
tab_out-value = t_bkpf-bktxt.
ENDIF.
MODIFY tab_out INDEX sy-tabix.
Reference Document Number - Header
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'XBLNR'.
IF d_bschl = '29'.
tab_out-value = t_bseg-xref1. " for down payment request
ELSE.
tab_out-value = t_bkpf-xblnr.
ENDIF.
MODIFY tab_out INDEX sy-tabix.
Symbol '/'
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_SYMBOL'.
tab_out-value = d_symbol.
MODIFY tab_out INDEX sy-tabix.
Text 'Payment for'
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_TEXT'.
tab_out-value = d_text.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'D_TEXT'.
tab_out-value = d_text.
tab_out-xblnr = t_bkpf-xblnr.
MODIFY tab_out by bkpf-xblnr INDEX sy-tabix.
Posting date
CLEAR d_budat.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = t_bkpf-budat
IMPORTING
date_external = d_budat
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'BUDAT'.
tab_out-value = d_budat.
MODIFY tab_out INDEX sy-tabix.
ELSE.
Result flag
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'RESULT1'.
tab_out-value = d_result.
MODIFY tab_out INDEX sy-tabix.
ENDIF.
d_gross = d_netamt + d_tdsamt + t_bseg-qbshb.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'GROSSAMT'.
tab_out-value = d_gross.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
ENDFORM. " ZPAYMENT
*& Form zamtwords
text - If only 'Net Amount' is required
--> p1 text
<-- p2 text
FORM zamtwords TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
DATA: d_swnet TYPE regud-swnes, " take character format type
d_swnet1 TYPE bseg-dmbtr.
d_words(160),
d_words1(80),
d_words2(80).
<-- 21.05.2005
DATA: d_words(160),
d_words1(80) TYPE c,
d_words2(80) TYPE c.
DATA: len TYPE i.
<-- 21.05.2005
*zamtwords
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-SWNET'.
d_swnet = tab_in-value.
REPLACE ALL OCCURRENCES OF '*' IN d_swnes WITH ' '.
REPLACE ALL OCCURRENCES OF ',' IN d_swnet WITH ' '.
d_swnet1 = d_swnet.
CLEAR d_swnet.
PERFORM z_conv_amt USING d_swnet1 CHANGING d_swnet.
Return 'SWNET1' without commas
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'SWNET1'.
d_swnet = d_swnet1.
tab_out-value = d_swnet.
MODIFY tab_out INDEX sy-tabix.
Amount in Indian currency format
CALL FUNCTION 'Z_SPELL_AMOUNT_INR'
EXPORTING
amount = d_swnet1
IMPORTING
rupees_str = d_words.
Adjust 'd_words' left aligned
SHIFT d_words LEFT DELETING LEADING space.
<-- 21.05.2005
Split 'd_words' into 'd_words1' and 'd_words2'
since 'DEFINE' in SAPScript displays maximum 80 characters
d_words1 = d_words(80).
d_words2 = d_words+80(80).
*CALL FUNCTION 'C147_STRING_SPLIT_AT_POSITION'
EXPORTING
i_string = d_words
i_position = 80
IMPORTING
E_HEAD = d_words1
E_TAIL = d_words2.
len = STRLEN( d_words ).
Only 80 characters can be passed to one SAPScript symbol
Split 'd_words' into 'd_words1' and 'd_words2'
since 'DEFINE' in SAPScript displays maximum 80 characters
Check if string split is required
IF len > 80.
d_words1 = d_words(80). " First 80
d_words2 = d_words+80(80). " Next 80
Introduce an initial space in 'd_words2' if 80th character in
'd_words1' is space, as this space is not considered when 'd_words1'
value is passed to the SAPScript, since we need proper spacing
between 'd_words1' and 'd_words2' in the Cheque layout.
IF d_words1+79(1) = ' '.
SHIFT d_words2 RIGHT BY 1 PLACES.
ENDIF.
ELSE.
d_words1 = d_words.
d_words2 = space.
ENDIF.
21.05.2005 -->
Amount in words1
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'WORDS'.
tab_out-value = d_words1.
MODIFY tab_out INDEX sy-tabix.
Amount in words2
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'WORDS1'.
tab_out-value = d_words2.
MODIFY tab_out INDEX sy-tabix.
ENDFORM. " zamtwords
*& Form z_address
text
--> p1 text
<-- p2 text
FORM z_address TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
DATA d_bukrs TYPE bseg-bukrs.
DATA: t_t001 TYPE t001,
t_adrc TYPE adrc.
CLEAR: tab_in-value,t_t001,t_adrc.
READ TABLE tab_in WITH KEY 'REGUP-BUKRS'.
d_bukrs = tab_in-value.
CALL FUNCTION 'K_READ_T001'
EXPORTING
i_bukrs = d_bukrs
IMPORTING
e_t001 = t_t001
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
CALL FUNCTION 'RTP_US_DB_ADRC_READ'
EXPORTING
i_address_number = t_t001-adrnr
I_NATION = ' '
I_READ_DB =
IMPORTING
e_adrc = t_adrc
EXCEPTIONS
not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-NAME1'.
tab_out-value = t_adrc-name1.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-STREET'.
tab_out-value = t_adrc-street.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-CITY1'.
tab_out-value = t_adrc-city1.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'ADRC-POST_CODE1'.
tab_out-value = t_adrc-post_code1.
MODIFY tab_out INDEX sy-tabix.
ENDIF.
ENDFORM. " z_address
*& Form z_total_amt
text
--> p1 text
<-- p2 text
FORM z_total_amt TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'NETAMT_TOT'.
tab_out-value = d_netamt_tot.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'TDSAMT_TOT'.
tab_out-value = d_tdsamt_tot.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'GROSSAMT_TOT'.
tab_out-value = d_grossamt_tot.
SHIFT tab_out-value LEFT DELETING LEADING space.
MODIFY tab_out INDEX sy-tabix.
ENDFORM. " z_total_amt
*& Form Z_NET_AMT
text
-->TAB_IN text
-->TAB_OUT text
FORM z_net_amt TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.
TYPES: imis_type_c20(20) TYPE c,
imis_type_c10(10) TYPE c.
DATA: l_intern TYPE imis_type_c20.
DATA: e_intern TYPE imis_type_c10.
DATA: i_extern TYPE imis_type_c10.
DATA: d_belnr(10),
d_bukrs TYPE bseg-bukrs,
d_gjahr TYPE bseg-gjahr,
d_umskz TYPE bseg-umskz,
d_bschl TYPE bseg-bschl,
d_dmbtr1 TYPE bseg-dmbtr,
d_dmbtr(17). "prb16052006
d_dmbtr1 like regud-swnes. "prb16052006
DATA d_amt TYPE char18.
DATA: BEGIN OF t_bseg OCCURS 10,
bukrs TYPE bseg-bukrs,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
buzei TYPE bseg-buzei,
dmbtr TYPE bseg-dmbtr,
wrbtr TYPE bseg-wrbtr,
umskz TYPE bseg-umskz,
bschl TYPE bseg-bschl,
qbshb TYPE bseg-qbshb,
NEbtR TYPE BSEG-nebtr, "prb13052006
END OF t_bseg.
<-- 21.05.2005
DATA: d_words(160),
d_words1(80) TYPE c,
d_words2(80) TYPE c.
DATA: len TYPE i.
<-- 21.05.2005
DATA wa_payrq TYPE payrq. " 15.07.2005 Rakesh
Read incoming data
CLEAR: d_belnr,d_bukrs,d_gjahr.
Company code
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BUKRS'.
d_bukrs = tab_in-value.
Document number
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BELNR'.
d_belnr(10) = tab_in-value(10).
Posting Key
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-BSCHL'.
d_bschl = tab_in-value.
Special G/L Indicator
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-UMSKZ'.
d_umskz = tab_in-value.
Fiscal Year
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-GJAHR'. " Note
CHECK sy-subrc = 0.
d_gjahr = tab_in-value.
Check if Down payment
IF d_bschl = '29'.
IF d_umskz EQ 'A'
OR d_umskz EQ 'B'
OR d_umskz EQ 'I'
OR d_umskz EQ 'M'
OR d_umskz EQ 'D'.
Put Document Number of the Payment Document value to 'd_belnr'
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
ENDIF.
ENDIF.
Check if Down payment request
IF d_bschl = '39'.
Put Document Number of the Payment Document value to 'd_belnr'
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
ENDIF.
<--15.07.2005 Rakesh
Check if Payment request exists in 'payrq'
CLEAR wa_payrq.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
SELECT SINGLE keyno augbl FROM payrq
INTO CORRESPONDING FIELDS OF wa_payrq
WHERE keyno = d_belnr.
IF sy-subrc = 0. " Yes
Take clearing document which is the required accounting document
d_belnr = wa_payrq-augbl.
Convert 'd_belnr' to 10 digits,if required
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
Get BSEG data
SELECT bukrs belnr gjahr buzei augbl rebzg rebzj sgtxt dmbtr wrbtr
qbshb nebtr
FROM bseg INTO CORRESPONDING FIELDS OF TABLE t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr
AND buzei EQ d_buzei
AND bschl EQ '25'
AND koart EQ 'S' " G/L accounts
AND shkzg EQ 'S'. " Debit
ELSE. " No
For all other cases, we use this final logic, even though we have
taken d_belnr value from accounting doc no., in some earlier cases.
Put document number of the payment document(vblnr) value to 'd_belnr',
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUP-VBLNR'.
d_belnr = tab_in-value.
-->15.07.2005
Convert 'd_belnr' to 10 digits.
CLEAR: l_intern,e_intern.
CALL 'CONVERSION_EXIT_ALPHA_INPUT' ID 'INPUT' FIELD d_belnr
ID 'OUTPUT' FIELD l_intern.
e_intern = l_intern+10.
CLEAR d_belnr.
d_belnr = e_intern.
*BSEG - PARTIAL PAYMT/FULL PAYMT WT DISC - Get Total Amount without Bank
*charges
SELECT bukrs belnr gjahr buzei augbl rebzg rebzj sgtxt dmbtr wrbtr
qbshb bschl NEBTR
FROM bseg INTO CORRESPONDING FIELDS OF TABLE t_bseg
WHERE bukrs EQ d_bukrs
AND belnr EQ d_belnr
AND gjahr EQ d_gjahr
AND buzei EQ d_buzei
AND bschl EQ '25'
AND ( koart EQ 'K' OR koart EQ 'D' ).
<--15.07.2005 Rakesh
ENDIF.
-->20.10.2005 By Yogesh.
CLEAR d_dmbtr.
IF sy-subrc = 0.
LOOP AT t_bseg.
d_dmbtr = d_dmbtr + t_bseg-dmbtr - t_bseg-qbshb.
SELECT SINGLE shkzg INTO (shkzg) FROM tbsl
WHERE bschl = t_bseg-bschl.
*BREAK-POINT.
*******prb13052
IF shkzg = 'S'.
d_dmbtr = d_dmbtr + t_bseg-wrbtr - t_bseg-qbshb.
ELSEIF shkzg = 'H'.
d_dmbtr = d_dmbtr - t_bseg-wrbtr - t_bseg-qbshb.
ENDIF.
IF shkzg = 'S'.
d_dmbtr = d_dmbtr + t_bseg-nebtr." - t_bseg-qbshb.
ELSEIF shkzg = 'H'.
if t_bseg-nebtr <> ''.
d_dmbtr = d_dmbtr - t_bseg-nebtr." - t_bseg-qbshb.
else.
d_dmbtr = d_dmbtr - t_bseg-wrbtr." - t_bseg-qbshb.
endif.
ENDIF.
*tables: reguh, payr.
select single * from reguh where zbukr = d_bukrs
and vblnr = d_belnr
and LAUFD+6(4) = d_gjahr.
*select single * from payr where zbukr = d_bukrs
*and vblnr = d_belnr
*and hbkid = reguh-hbkid
*and hktid = reguh-hktid.
*d_dmbtr = payr-rwbtr.
*if d_dmbtr < 0.
*d_dmbtr = d_dmbtr * ( -1 ).
*endif.
CLEAR tab_in-value.
READ TABLE tab_in WITH KEY 'REGUD-SWNES'.
d_DMBTR = tab_in-value.
translate d_dmbtr using '* '.
translate d_dmbtr using ', '.
condense d_dmbtr no-gaps.
d_dmbtr1 = d_dmbtr.
*******prb13052
ENDLOOP.
PERFORM z_conv_amt USING d_dmbtr CHANGING d_amt.
*Pass the Net Amount output to the outgoing table tab_out-name =
*'NETAMT_TOT'.
CLEAR: tab_out-value,tab_out-name.
READ TABLE tab_out WITH KEY 'NETAMT_TOT'.
tab_out-value = d_amt.
" For inserting '*' ahead of value
SHIFT tab_out-value LEFT DELETING LEADING space. """"????IMP
MODIFY tab_out INDEX sy-tabix.
Get the Amount in words for Indian currency
Can also use the FM 'HR_IN_CHG_INR_WRDS'
CALL FUNCTION 'Z_SPELL_AMOUNT_INR'
EXPORTING
amount = d_dmbtr1
IMPORTING
rupees_str = d_words.
Shift left since above Function Module introduces an initial space
SHIFT d_words LEFT DELETING LEADING space.
<-- 21.05.2005
*CALL FUNCTION 'C147_STRING_SPLIT_AT_POSITION'
EXPORTING
i_string = d_words
i_position = 80
IMPORTING
E_HEAD = d_words1
E_TAIL = d_words2.
len = STRLEN( d_words ).
Only 80 characters can be passed to one SAPScript symbol
Split 'd_words' into 'd_words1' and 'd_words2'
since 'DEFINE' in SAPScript displays maximum 80 charact -
List of tcodes and their purpose starting from SE71 to SE84
Can i get the list of tcodes and their purpose starting from SE71 to SE84.
hi,
u can find these details in table TSTC.
SE71 SAPMSSCF 1100 4 SAPscript form
SE72 SAPMSSCS 1100 4 SAPscript Styles
SE73 SAPMSSCO 500 4 SAPscript Font Maintenance
SE74 SAPMSSCU 1 4 SAPscript format conversion
SE75 SAPMSSCC 1 0 SAPscript Settings
SE75TTDTGC 2 SAPscript: Change standard symbols
SE75TTDTGD 2 SAPscript: Display standard symbols
SE76 SAPMSSCG 1100 0 SAPscript: Form Translation
SE77 SAPMSSCG 1200 0 SAPscript Styles Translation
SE78 SAPMSSCH 2000 0 Administration of Form Graphics
SE80 SAPMSEU0 2 Object Navigator
SE81 SAPMSEU10 1000 84 Application Hierarchy
SE82 SAPMSEU9 1000 84 Application Hierarchy
SE83 2 Reuse Library
SE83_START RLB_BROWSER_START 1000 80 Start Reuse Library
SE84 RS_INFOSYSTEM_START 1000 84 R/3 Repository Information System
reward points if hlpful. -
Barcode C128 is not getting displayed in Sapscript
HI,
I need to print the barcode in the Sapscript.
The barcode is not getting displayed even in the preview also, when I give the Barcode C128.
But when I give other Barcodes, it is getting displayed in the preview.
Can anyone let me know the solution to print the barcode for C128, as others are not that much fit to print.
Thanks
RakeshHi Dieter,
No. I haven't.
Is this the reason for that?
let me know the procedure.
thanks
Rakesh -
SAPSCRIPT form - Text is not porperly displayed
hi all,
in my SAPSCRIPT form, I am getting a text from PERFORM stmt. in the PERFORM , the text is coming correct, but in the form , it is showing only half of the text.
the code
FORM get_text TABLES ts_intab STRUCTURE itcsy
ts_outtab STRUCTURE itcsy.
DATA: l_haul_text(500) TYPE c,
l_haul_long(250) TYPE c.
l_haul_long = l_haul_text+0(250).
LOOP AT ts_outtab.
CASE ts_outtab-name.
WHEN 'L_HAUL_LONG'.
ts_outtab-value = l_haul_long.
MODIFY ts_outtab.
ENDCASE.
ENDLOOP.
Then in the form, just display
/: PERFORM GET_TEXT IN PROGRAM
/: USING &VBDKL-VBELN&
/: CHANGING &L_HAUL_LONG&
/: ENDPERFORM
&L_HAUL_LONG&
while debugging, the text is correct till TS_OUTTAB but when it comes to the form L_HAUL_LONG, it is truncated.......what should i do..
Kindly help.
THnaksanswered
-
Fields not getting displayed in Sapscript
Hi Guyz,
I have a customized Sapscript form ZPV_INVOICE and its print program RVADIN01. This form outputs the Sales Invoice. When the print preview is triggered, Material number (MATNR) is not getting displayed on the form. However, when the form is debugged, MATNR values are properly fetched and showed (while debugging only, not in output).
Can somebody please let me know the reason, why the MATNR is not getting displayed on the output, even though it is showing values while debugging.
Thanks in advance !Hi ,
Then check matnr field which is display is same what you are checking in debugging .
COnfirm the field and check whether data stays till end of module .
regards
Deepak. -
Blank page is getting displayed in SAPScript when using NEW-PAGE option.
Hello Experts,
We have created a customized SAPScript and in this separate Script is generated based on the currency(WAERS).
So if we have 3 different currencies, then 3 pages will be created with there details, but we are using NEW-PAGE option in
MAIN window to separate the pages and after 3rd page it is displaying 4th page also with footer details.
So how can we avoid last blank page which is getting displayed?Hi isha.walia ,
This issue can be solved by two ways. Please take the one which suits you better.
Solution 1: If you need to generate separate prints for different currencies.
In the driver program, build an internal table for different currencies which needed to be printed. (Using delete adjacent duplicates, build the internal table with exact number of currencies to be printed). Remove the NEW-PAGE option and call the script/form inside the loop. Do the necessary conditions to manipulate the print.
Advantages of above solution: Better control on spools if needed.
Solution 2: Get the count of the number of pages in a variable. Inside the print loop, increment a flag counter. Check it against the variable which contains the number of pages to be printed at the end of each page. Exit the loop when the number of pages to be printed is reached.
Advantage of above solution: Simple to write the program.
Thanks and Regards
Raghesh R S -
HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS
HI,
HOW TO DISPLAY THE TEXT ON A PARTICULAR PAGE IN SAPSCRIPTS?in ur script main window
/: IF &TTXSY-PAGE& = 15.
ur text or standard text
/: ENDIF.
use this.
hope it helps if any issues revert back -
Display sapscript form in Web Dynpro Java
Hi,
Is it possible to print an existing sapscript form i.e. PO from ECC to my Web Dynpro application? I have successfully created a Web Dynpro Java application to create POs but now have a requirement to display or print the PO?
Can someone provide me with a sample code? I'm hoping to be able to do this without using Adobe.
Again, thanks for all your help.
Best regards,
JaypeeHi mark,
Without Adobe also u can display PO order.
Below is the code to open a HTML window from WDJava, with data from WDJava...
Inside DoInit()
IWDAttributeInfo attr1 =
wdContext.getNodeInfo().getAttribute("htmlfile");
ISimpleTypeModifiable mtype1 = attr1.getModifiableSimpleType();
IWDModifiableBinaryType btype1 = (IWDModifiableBinaryType) mtype1;
btype.setFileName(attr.getName() + ".html");
btype.setMimeType(WDWebResourceType.HTML);
_contentType = mtype;
Where htmlfile is a context attribute of type binary... and do a global declaration like this
ISimpleTypeModifiable _contentType = null; (This declaration can be done at the end of your view's coding between Begin Others and End Others)
Now,
inside on action print
public void onActionPrintData(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String videoName )
//@@begin onActiondisplayVideo(ServerEvent)
byte[] content = new byte4028;
try {
content = this.displayPrint().getBytes("UTF-8");
wdContext.currentContextElement().setHtmlfile(content);
wdContext.currentPrintElement().setAttrUrl(
_contentType.format(content));
//Where content is loaded with data from displayPrint() method, which is holding the HTML *page to be displayed to the user *
IWDWindow win =
wdThis
.wdGetAPI()
.getComponent()
.getWindowManager()
.createNonModalExternalWindow(WDWebResource
.getWebResource(content, WDWebResourceType.HTML)
.getURL(),"ShowVideo");
win.setWindowSize(445,460);
win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
win.removeWindowFeature(WDWindowFeature.MENU_BAR);
//win.open();
win.show();
// wdComponentAPI.getMessageManager().reportSuccess("444444444444");
} catch (Exception e) {
wdComponentAPI.getMessageManager().reportException ("Unable to open window"+e,false);
//@@end
Now finally, design your HTML Page inside the method displayPrint() like this
public java.lang.String displayPrint( java.lang.String strVideoName )
//@@begin displayPrint()
String htmlcontent=null;
htmlcontent="content what you want to show in print window";
use script inside the html content to do a print... like window.print();
return htmlcontent;
//@@end
Regards,
Sunaina Reddy T -
Urgent! How to display more than 1 line of text in SAPSCRIPT using tab
Hi, i would like to know how do i display all the text (which may consist of more than 1 line) that i have extracted using a READ_TEXT FM in my print program? Once the text has been extracted and displayed, i would like the proceeding lines of text (if there are more than 1 line) to begin at a certain margin (i have defined a paragraph format as 6.2cm in tab option).
Have a look at the part of the print program that has the READ_TEXT FM statements which is going to extract the text from the PR Document header:
LOOP AT ITAB.
CLEAR: PR_TXT, PR_TXT[].
L_NAME = ITAB-BANFN.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'B01'
LANGUAGE = SY-LANGU
NAME = L_NAME
OBJECT = 'EBANH'
ARCHIVE_HANDLE = 0
* LOCAL_CAT =
TABLES
LINES = PR_TXT
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
LOOP AT PR_TXT.
MOVE: ITAB-BANFN TO PTXT_TAB-BANFN,
SY-TABIX TO PTXT_TAB-POSNR,
PR_TXT-TDLINE TO PTXT_TAB-LINE.
APPEND PTXT_TAB.
ENDLOOP.
As for my SAPSCRIPT, i did the following:
* Purchase Request Header : &PTXT_TAB-LINE(C)&
I would like all of the proceeding lines of text to appear at the same margin as when the first line of &PTXT_TAB-LINE& started (which i have found out is 6.2cm, so i created a tab called HT for this)
Message was edited by: Bernard LohREPORT ZZZZANC9 .
tables mara.
data: i_mara like mara occurs 0 with header line.
select matnr from mara
up to 100 rows
into corresponding fields of table i_mara
where matnr ne space.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'ZZZZANC1'
LANGUAGE = SY-LANGU
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at i_mara.
mara-matnr = i_mara-matnr.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MATERIAL'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endloop.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Look through above code. Sapscript should contain a text element (/E control) as below
/E MATERIAL
&mara-matnr& -
To display a sapscript layout by cliking a Button
Hi Friends
Given a sapscript. When i execute the script prog the output should be
displayed
as a report first and when we click the button PRINT the same report
should be displayed in script layout .
But now iam able to disply only the header . unable to display the main
window...
why?.. I called the func modules as follows .. the windows are header
and main...
CASE in_ucomm.
WHEN 'PRINT'.
PERFORM print_sapscript.
ENDCASE.
form print_sapscript .
CLEAR options.
options-tddest = '*'.
options-tdimmed = '*'.
options-tddelete = '*'.
options-tdnewid = 'X'.
PERFORM print_popup_msg.
PERFORM start_form.
PERFORM write_report2.
PERFORM end_form.
PERFORM close_form.
endform.
in print_popup_msg i called open_form..and write_report as
form write_report2 .
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = '100'
window = 'AAA' " this is the element in header window
EXCEPTIONS
OTHERS = 1.
endform. " write_report2
iam having six elements defined in MAIN window how to call the six
elements....
Hope will suggest me as soon as possible.. Will be waiitng ..
Thank YouHI SAi,
to call the Text elements...
go to sapscript command editor.
select text element in command prompt.
/E 100
PR &fld1&
/E 200
PR &FLD2&
/E 300
PR &FLD3&
PR is paragraph format.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
<b>element = '100' " this is text element name
window = 'MAIN' " this is window name</b>
EXCEPTIONS
OTHERS = 1.
Regards
SAB
Maybe you are looking for
-
All of a sudden when printing from my desktop Mac in IPhoto the printout comes out black. My colors are fine on my HP color laser printer. I have printed many times and now all of a sudden it is not printing. A test copy from my printer comes out
-
Creative MediaSource and ID3 t
Creative MediaSource doesn't seem to update it's internal database from ID3 tags. For example I ripped a CD and MediaSource failed to get the year of the album. So, I added the information to the Id tags using Winamp. I reimported the file into Media
-
Hello is it possible to assign two terms of payment for a single vendor for a single purchase org if yes how is it maina
-
What's the best way to keep two computers synchronized?
I just got Lr4, which I use in addition to CS5.5 Design Premium, and I want to use Lr as the primary raw file manager and editor. I keep my work and home computers synchronized via a 2TB external drive that fits in my pocket, and SmartSync Pro softwa
-
I don't know where to submit a new feature request, so posting it here. Please refer me to a more appropriate site, if available. Thanks in advance. iPhone currently allows up to 16 application icons per home screen. With more and more useful apps in