Item level display in SAP script
Hi All,
I am trying to show the line items of sales invoie in the invoice layout using SAP script. But it displays just one line item. It overwrites the same line on every call. How can I instruct it to print it on the next line. I've even tried printing the line using '/' (line feed) but to no effect.
Please help,
Regards,
Madhur
Hi Vinod,
I am doing the same thing as you suggested. Here's the code I am using. This is for the disclaimer text that is being picked up and consists of multiple lines.
SAP Script for window DISCLAIM->
/E DISCLAIMER
C1 Disclaimer
P1 &W_DISLINES&
Program Code ->
Print Disclaimer
LOOP AT I_T_LINES.
W_DISLINES = I_T_LINES.
PERFORM WRITEFORM USING 'DISCLAIMER' 'DISCLAIM'.
ENDLOOP.
FORM WRITEFORM USING VALUE(P_ELEM)
VALUE(P_WIND).
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = P_ELEM
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = P_WIND
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "WRITEFORM
Similar Messages
-
Hello Friends,
I have a report which prints Normal Tax invoice & Returns Tax, I modified this report just by adding one extra "delivery channel". The report call one more program which dose the printing job based on the delivery no.
The issue, I can able to see the header data in th the print preview of the tax invoice, and not able to see item level data.
Please help me how to resolve this issue.
Regards,
ShreekantHi,
You need to pass the line item data to the smartform/script. Please check in debug mode whether the data is passed correctly.
Best regards,
Prashant -
ABAP QUERY PROGRAM OUTPUT SHOULD DISPLAY FROM SAP SCRIPT.
THIS IS MY URGENT REQUIREMENT ...
I DONT KNOW ABAP QUERY PROGRAM ..
PLEASE SUGGEST ME A WAY ON THIS ....
Functional requirements
Introduction
The wish of the customer is a printable customer overview. All desired fields will be shown in a new query called ZZADDRSS_CO. Double entries are taken for granted because of the data taken from the sales area and because of multiple contact persons. The customer accepts this. It should be made possible that the user creates and saves its own variant.
A second overview is needed, another ABAP will be developed for this requirement. This ABAP will show all the customer data and this list will have the possibility to be printed.
Solution
New Query ZZADDRESS_CO
The desired fields of attachment 1 need to be shown in the query.
The selection criteria are shown in attachment 2.
The column names of the additional data have to changed in the query.
Customer Overview.
Functional specification.
On behalf of this customer overview a standard SAP transaction will be used (transaction VC/2).This transaction will be extended.
The fields are shown on screen with the described headers. Printing of the overview will be done via SAP script. The script makes use of a fixed layout of the data.
The selection criteria are specified in attachment 2.
The layout of the customer overview and the SAP Script are specified in attachment 3.
Specification.
The next steps need to be performed.
1. A routine per infoblock need to be created in Include RV77UNNN. In this routine the data is retrieved and written down to the screen and script,
Example LST1_901 . In include RV77SNNN you can find the standard infoblocks.
2. Adapt via transaction SE16 table TFRM.
3. Create a new view in the customizing (sales and distribution- Sales support-sales summary-Assign Reporting Views).Assign the new view to the infoblocks.(Example view 001 is assigned to block 901).
4. In customizing it is not possible to assign the correct window and element to the infoblock .so this is done via SE16 in table T182A.
5. Adapt script. Copy script SD-SALES-SUMMARY to a Z-SALES_SUMM.
Assign this new version to the new view in customizing. Create in the main window the element who writes the data on behalf of the print.
Attachment 1 Desired fields
Header: Address
~ Customer number KNA1-KUNNR
~ Title KAN1-ANRED
~ Name1 ADRC-NAME1
~ Name2 ADRC-NAME2
~ Name3 ADRC-NAME3
~ Name4 ADRC-NAME4
~ PO Box ADRC-PO_BOX
~ PO Box POSTAL CODE ADRC-POST_CODE2
~ PO Box city ADRC-PO_BOX_LOC
~ Telephone no1 ADR2-TEL_NUMBER 1ST RECORD
~ Telephone no2 ADR2-TEL_NUMBER 2ND RECORD
~ Fax number1 ADR3-FAX_NUMBER 1ST RECORD
~ Fax number2 ADR3-FAX_NUMBER 2ND RECORD
~ E-mail ADR6-SMTP_ADDR
~ Search item ADRC-SORT1
~ Notes ADRT-REMARK
Header: control data
~ VAT registration number KAN1-STCEG
Header: Payment transactions
~Bank country key KNBK-BANKS
~Bank key KNBK-BANKL
~Bank Account number KNBK-BANKN
Header: Marketing
~ Industry key KNA1-BRSCH
~ Industry code 1 KNA1-BRAN1
~ Industry code 2 KNA1-BRAN2
~ Industry code 3 KNA1-BRAN3
~ Industry code 4 KNA1-BRAN4
~ Industry code 5 KNA1-BRAN5
~Annual sales, currency, year KNA1-UMSA1, KNA1-UWAER, KNA1-UMAH
~ Yearly no of employees, year KAN1-JMZAH, KNA1-JMJAH
~ Fiscal year variant KNA1-PERIV
~Legal status KNA1-GFORM
Header: Correspondence
~ Our account number at customer KNB1-EIKTO
Header: sales
~ Sales office KNVV-VKBUR
~ Customer group KNVV-KDGRP
~ ABC-classification KNVV-KLABC
Header: Invoice
~Tax classification KNVI-TAXKD
~Terms of payment key KNVV-ZTERM
~
Header: Contact Persons
~Title KNVK-ANRED
~Name KNVK-NAME1
~Advertising material KNVK-NMAIL
~Martial Status KNVK-FAMST
~Notes KNVK-PARAU
~Function KNVK-PAFKT
~Department KNVK-ABTNR
Header: Partnerroles
~Personnel Number KNVP-PERNR
~Name of employee PA0001-ENAME
Header: Additional Data
~Attribute 1 KNA1-KATR1
~Creation date KNA1-ERDAT
~Attribute 2 KNA1-KATR2
~Change date of field KNA1-KATR2 CDHDR-UDATE
~Attribute 3 KNA1-KATR3
~Attribute 4 KNA1-KATR4
~Attribute 5 KNA1-KATR5
~Attribute 6 KNA1-KATR6
Attachment 2 Selection fields
~Customer number
~Sales office
~Personnel Number
~Sales Organization (default NL01)
~Industry key
~Industry codes (1 till 5)
~ABC- classification
~Creation date
~Attribute 1
~Attribute 2
~Attribute 3
~Attribute 4
~Attribute 5
Attachment 3 Customer overview + SAP Script
Customer master data sheet: 11490 Page1
Requested by karen Dunnewold Date: 25.08.2004
Address
(Default SAP script ADDRESS statement)
Title
Name1
Street + number
PO Box city
Country
Search term: ADRC-SORT1
Telephone 1: ADR2-TEL_NUMBER 2: ADR2-TEL_NUMBER
Fax 1: ADR3-FAX_NUMBER 2: ADR3-FAX_NUMBER
E-mail: ADR6-SMTP_ADDR
Notes: ADRT-REMARK
PO BOX
ADRC-PO_BOX
ADRC-POST_CODE2 ADRC-PO_BOX_LOC
T005T-LANDX (T005T-LAND1 = ADRC-COUNTRY)
Control data
VAT registration number: KNA1-STCEG
Payment transactions
Country: KNBK-BANKS Bank-key: KNBK u2013 BANKL Bank account: KNBK-BANKN
Marketing
Industry KNA1-BRSCH Industry Description
Industry code1 KNA1-BRAN1 Industry Description
Industry code2 KNA1-BRAN2 Industry Description
Industry code3 KNA1-BRAN3 Industry Description
Industry code4 KNA1-BRAN4 Industry Description
Industry code5 KNA1-BRAN5 Industry Description
Figures
Annual Sales KNA1-UMSA1, KNA1-UWAER in KNA1-UMAH
Employees KNA1-JMZAH in KNA1-JMJAH
Legal status KNA1-GFORM description
Customer master data sheet 11490 Page 2
Requested by karen Dunnewold Date: 25.08.2004
Contact Persons
KNVK-ANRED
Mailings: KNVK-NMAIL Notes: KNVK-PARAU
KNVK-ANRED
Mailings: KNVK-NMAIL Notes: KNVK-PARAU
Correspondence
Our account number at customer KNB1-EIKTO
Sales
Sales office KNVV-VKBUR Description
Customer group KNVV-KDGRP Description
ABC-classify KNVV-KLABC
Currency KNVV-WAERS
Invoice
Terms of payment key KNVV-ZTERM Tax classification KNV1-TAXKD
Description
Partner (Leave SAP default)
Partnerrole Number Name
KNVP-PARVW KNVP-KUNNR NAME1
KNVP-PARVW KNVP-KUNNR NAME1
Additional data
Attribute1 kna1-katr1 Description
Attribute2 kna1-katr2 Description
Attribute3 kna1-katr3 Description
Attribute4 kna1-katr4 Description
Attribute5 kna1-katr5 Description
Attribute6 kna1-katr6 Descriptionhi narayana
i think u need to write a driving program and a provided with a smatform u sit along with the SD consultant.
ur further views can be shared.
Rgs,
Venkat. -
Item level display in adobe forms..
Hi all,
I have a problem on adobe forms....For my req. I have fields like delv no , delv item , matnr,
Customer mat no, qty , batch no and split no to display in line item level...but for one delv no there are
multiple batch and split no..If i tried to display the second delv is overlapping with second line item of
the first delv ..can any tell me how to avoid this?Hi Dude...
create separate internal tables for line item and field for which you want to display multiple values
with common field..
For your example..
step 1. create an internal table for line item that contains the delivery no , del item, material no,
material qty, customer mat no, batch no and serial no...
Step 2. Create an internal table for batch and serial no with common fields , del item and del no.
Step 3. Go to context ..assign this second internal table under line item internal table ..
step 4. Double click on the second internal table and go to condition...there you to write the below
condition....
line item- delv = 2nd internal table-delv
and
line item -delv item = 2nd internal table-delv item...
I hope this will solve your problem... -
Hi All,
I want to execute the sapscript form MEDRUCK.I want to check how the SAP Script form medruck looks like. I even check its print program but it is not executable program. Then how can I display its output ie how it look.
Thanks
harpreet
Message was edited by: harpreet SinghHi,
If you want to see the output of the form MEDRUCK..you need to execute the transaction with some billing Document ot invoice number.
Here for your understanding you can execute the transaction VF03 and give any billing document. Then goto Menu Billing document->Issue Output to->Printer. Here you need Output type to see the layout of the same. So pass the output type defined to this billing document. In order to see the output type..pass the billing document and press enter. In the menu Goto->header->output and see the output types defined for the same.
Once you pass the output type and click on print preview you will see the layout of that particular billing document.
For getting the Driver Program and output type you can goto table NACE and pass the form name and you get the program name and output typr for that form.
Regards,
Ram Mohan
Pls reward points if useful.. -
How to display in sap-script the data which is input in selection screen by the user.
Hii,
I want to display the data in sap-script that has been input by the user in selection screen.
Suppose the the user has done input for posting date from 25.1.2001 to 25.1.2005,what i want is to display this date in sap script.
How can i do it.
please help asap.
Regards.Hi,
If select-option name is s_erdat.
then from value will be s_erdat-low and to value will be s_erdat-high.
Arivazhagan S -
Quantity Field Display in Sap Scripts
Hi,
I am displaying the quantity field in the sap script layout.But in the quantity field having 3 decimal places.
Ex: 3.400 is there i want to display 3.4
3.000 only i want to display 3
3.740 -
3.74 like that i want.
I want to omit the zeros after decimal places.
Please give me the solution.
Regards,
JennyAs it is quantity field, it will print even the decimal points...U can try this...move the value to a char variable and use truncating to remove zeros by deleting them and use this value in ur script to print the value.
-
Standard text display in sap script
Hi Experts,
The standard text will be stored in Name = ORDCONF_TEXT_(sales org)_(distributionchannel)_(division)
Text ID = ZSD
Examples: ORDCONF_TEXT_4000_01_01 , ORDCONF_TEXT_4000_01_80 , ORDCONF_TEXT_1000_01_01.
Requirement :
The print program /form will need to pick up the appropriate standard text based on the Sales Area (combination of Sales Org / Distribution Center / Division) of the sales order [VBAK-VKORG / VTWEG / SPART], provided a standard text has been created for that Sales Area. Itu2019s not required that every sales area have a standard text, so if one is not found, this step should be skipped and the rest of the print program executed.
The new text should print after 2 blank lines after the Printable Notes text (which is after the line items and the Total Net Price prints).
The font should be the same size as the Printable Notes, but bolded rather than italicized.
The text should print in the same columns as the Printable Notes currently print in (Material Description / Scheduled Ship Date / Quantity) .
So the logic i have used is this below code:
I used a subroutine in the layout of the main window becoz i need to print it in the main window below after 2 blank lines of line items.
This is logic in the layout:
/: DEFINE &ORDCONF_TEXT& :='ORDCONF_TEXT_&VBDKA-VKORG&_&VBDKA-VTWEG&_
/: &VBDKA-SPART&'
/:PERFORM GET_OBJECT IN PROGRAM ZSDRP001_ORD_CONF_IRE
/:USING &VBDKA-VBELN&
/:CHANGING &ORDCONF_TEXT&
/:ENDFORM
/:INCLUDE &ORDCONF_TEXT& OBJECT TEXT ID ZSD PARAGRAPH A1
I called this subroutine in the print program:
Logic in the print program:
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
But still its not getting printed .Plz tell me where i am going wrong.
Thanks,
Suman
Edited by: Rob Burbank on Nov 13, 2009 4:18 PMHi sirisha
I have clarification
The standard text will be stored in Name =COCDADDR_TEXT_(paying company)
Text ID = ADRS
Examples: COCDADDR_TEXT_0500, COCDADDR_TEXT_1000, COCDADDR_TEXT_2401,COCDADDR_TEXT_2405,COCDADDR_TEXT_7600,COCDADDR_TEXT_7700
Requirement :
The print program /form will need to pick up the appropriate standard text based on the paying companycode of the REGUH-ZBUKR, provided a standard text has been created for that paying companycodes. Itu2019s required that every sales area have a standard text (ADDRESS of company), so if one is not found, this step should be skipped and the rest of the print program executed.
I need the steps similar to ur issue.
Thanks in advance
Senthilkumar -
The next page in not displaying in the SAP Script
Hello,
I had one SAP script. There were two pages in the script and i mentioned the next page also for the FIRST and NEXT page as
First - next page --> next
and next -- next page --> next
Now, I am having 3 items which needs to be gets displayed using SAP script.
The first two items displayed properly but the third item is not getting displayed, as of the size of main window is small.
Whenver i am increasing the size of main window the third item gets displayed propely.
But i guess whenever the data will get overflow in main window then it should gets displayed in the next page, this is not happening in my case.
Can any one tell me, how to display the next page whenver the data will get overflow in main window?
Please help me with this.
Thanks in advance
Regards,
DarshanaHi Darshana,
if you use text element for the item output, you will need same text element on NEXT page. Check for Typos. Switch on sapscript debugger and check what happens.
Regards,
Clemens -
Text display issue in SAP script
Hi All,
I have developed a sap script (Invoice) which is having a Footer window.
The footer window should display page number and some text (address of company). The address data is stored in an internal table and the same will be made to display in sap script.
Now my problem is the address data is displaying correctly in the second page. But no data is getting displayed in the first page. If the Invoice is of single page, the address data in Footer window is getting printed properly.
The problem occurs only, when the invoice is of multiple pages....
What might be the problem in this regard...??????
Please help me, as this bug need to be fixed as early as possible....
Regards
PavanThe size of MAIN and FOOTER window are not getting truncated. Both window have designed properly.
In the first page, the footer window will display Page No data and the address data will be invisible. In debig mode, i can see the value of address will be passed to text symbols of sap script.
There are no conditions set in the sap script for Footer window.
one more observation is that after execution (at print preview screen), if i go back and again click for print preview, the address data is getting printed in the first page...!!!
Regards
Pavan -
Error while displaying SAP script
Hi,
I was trying to display a SAP script by passing the values.
When i click the preview button from the Dialog window It's displaying error called "CALL CONTAINED error (ADS(2)) "
Can anyone explain why this problem is coming and what we want to do for making it work.Hi,
Check for the data types of the variables you are passing values.
There can be any data miss match.
Regards,
Rajesh Kumar -
Invoice List SAP script - Problem with SAP script functionality
Hello Friends,
I am working on SAP script - Invoice List SD_INVOICE_LIST. The invoice list contains the underlying billing documents. As per the standard functionality, in the line items, its printing the underlying billing documents with the net value. My requirement is to dig these line items into another level, meaning, I need to display the line items of billing documents as well(like material, material description, quantity, net price and net value of that item etc).
The billing linte item informatin is stored in VBRP table and the VBRP structure is not at all defined in the print program of SD_INVOICE_LIST (I.E.RVADIL01). Change of standard SAP program is not an option for me here.
In the external subroutine we can fetch these line items for each billing document in the invoice list. However, my question here is how to take these line items back to the sap script and print them in SAP script (We can print one line item but how to loop these fetched lines and print them on SAP script. Any help in this regard would be greatly appreciated.
I think there is no standard smart form exist for the invoice list. Please also let me know if there is any standard smart form available for INVOICE List.
Thanks in advanace for any help in this regard.
Best regards,
SivaHi
As you cannot change the standard, you will have to see if there are any enhancements provided in the print program. if not you have to copy into a custom one and do changes accordingly.
Thanks,
Venkatesh -
Printing checkboxes in SAP script
Hi,
I have a requirement where I need to print checkboxes for all the items displayed in SAP Script output.
Is there any way to print checkboxes in the output document?
Regards,
Rajesh BhogiHi Rajesh,
Below link can be useful for you:
How to print u0080 in SAP Script
Hope this will help.
Regards,
Nitin. -
VAT line item wise display in MIRO screen
Hi Team,
When I am taking MIRO, I am getting the base value of the stock purchased at line item level.
When I put tick mark in calculate tax, tax getting calculate. But this is not appearing in the line item level display.
I am working in retail. Each document contains at least 20 line items. But the vat for this is appearing in gross level. this creates the problem in verification.
How can I get the VAT column also beside the amount column at the line item level.
Please suggest.
MalleshHi Malleswara Rao,
The VAT gets calculated in MIRO at gross level only. If clubs the multiple line items having same Tax Code to calculate the tax at gross level.
This is a standard design. You can also refer OSS note 1175418 which indicate the same kind of limitation in VAT processing.
https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1175418
Hope this will clarify.
Regards,
Gaurav -
Rounding off to a variable value to 4 decimal values in sap script ouput
Hi All,
I have a value getting displayed in sap script output as 235.6789 i want to Round off this variable value to 4 decimal values!
What is the formatting option need to be used & how!
Thanks in advance.
Thanks,
Deep.Hi,
1.In layout just call that variable, where you need like:
&variable(.4)&.
Just see these:
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
Regards,
If helpful reward with points(Don't forget).
Maybe you are looking for
-
How to select the output list check boxes
Hi ABAP gurus, I am developing the on report, it display the output list, in that output list first column is Check box, here i created the 3 Pushbuttons on application tool bar, one pushbutton is SELECT ALL, 2nd one is DESELECT ALL , 3rd one is
-
X220 i5-2410M msata work or not?
Hi, I have just ordered a X220 with the i5-2410m, and was about to also order a 64GB msata SSD. At first I thought i would be fine because the msata problems were only on i7 models, but now i have found a few people saying it also affects some i5 mod
-
Bug?: Tabular Form function "addRow" can't handle multi-line Row Templates
Hi all, i created a custom Report Template (Named Column Row Template) which creates 2 lines per Record (which in fact is 2 rows in a HTML table). In the APEX function initTabForm (apex_4_0.js) the sample row (f01_0000) is read and stored in gTabForm
-
Stopping scrollbar in subscreen
Hello Gurus, iam creating 2 subscreen using screen painter the thing is iam getting a scrollbar at the end of the screen which i dnt want?how to stop this scrollbar appearing ? Regards Janapathi
-
Nvidia incompatibility fixed with 195.62
nvidia driver 195.62 WHQL (release date 26-Nov-2009) has cured, for me, the instant PRE exit when selecting Edit> Transitions. i.e. all three nvidia driver components (display driver, 3d stereoscopic, physx) features are active. Cheers, Neale Insanit