Function MM_DELIVERY_ADDRESS_READ in PO print program
Hello everybody,
I'm using the function module MM_DELIVERY_ADDRESS_READ in a copy of the PO printing function group MEDRUCK to get the address number or address handle of an PO item. This works well in the preview of the messages but the problem is, that the function module doesn't seem to work for new messages, which are inserted and saved in the PO?
Does anybody know a fix for this problem or an alternative function module I can use?
Thanks
Daniel
Hi
Analyse the Dump in ST22 transaction
difficult to say , as what was changed in the program is not known exactly
from the dump you have to know
Regards
Anji
Similar Messages
-
Runtime error in print program of a smartform
Hi,
While trying to execute the print program of a smartform I am getting the following runtime error.
The reason for the exception is:
The call to the function module "/1BCDWB/SF00000288" is incorrect:
In the function module interface, you can specify only
fields of a specific type and length under "IT_BOOKINGS".
Although the currently specified field
"IT_BOOKINGS" is the correct type, its length is incorrect.
In the form interface of the smartform under tables parameters I have declared like this.
IT_BOOKINGS LIKE SBOOK
IT_SCHEDULE LIKE SPFLI
Can anyone tell me why do we get this error?
Regards,
HemaHello,
program to call smartform is really simple :
-> function SSF_FUNCTION_MODULE_NAME give you the name of the function link to your sapscript.
-> function WFMC_PREPARE_SMART_FORM help your to prepare your options to your smartform.
-> function xxx to call your smartform (find with the first function).
Sometimes you have to play with values of NAST (for ex) to find the language (set in control_parameters) or for example if you want to print without display (when it ask you for print / print preview and the name of the print device) .....
Frédéric -
Regarding custom print program does not recognize elements in new windows..
Hello Experts,
I copied the standard print program RFFOUS_C since I need to add new windows and routines. But when I
inserted my 'WRITE_FORM' to call the element in the new window it has an exception of '1' which I think it does not
recognize the custom elements in the new windows. Below is my code:
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'CHECK'
function = 'APPEND'
TYPE = 'BODY'
window = 'PAYEE'
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.
So I added the window 'PAYEE' and the code above was inserted in the routine 'SCHECK'. Hope you can help
me guys. Thank you and take care!r u using the ' check' text element in your script window?, if u don't delcare in the script window than only this kind of error will come.
Thanks,
Tirumal. -
Problems with Print Program of Production Order (CO03) !!
Hi all,
I have a question about Print program of Production Order. I created a new Order in CO01. Then, in CO03, I call Print Program ( menu <b>Functions >> Print</b>). At the first time, it printed a so-called original version. Later, when i printed it again, it informed me that just was a copy. Now, that's ok.
I made some modification of Print Program by copying and changing the code (let's call it Z_PSFCOBJL) and SAPScript form. However, When I call Print function in CO03 for that Order, it didn't show any changes which I made. What's wrong? I checked in the code by debug mode, the variable that I transfered to the form was correct with its value.
<b>I think that because SAP just make a print copy so that it will not reflect any changes that I made to the program, right? Is there any way to overcome this because I don't want to create new Orders just for testing every modification</b>?
Thank you in advance.Hi MURUGESAN THANGATHURAI ,
Yes, I did assign the new program and new form for this before printing. But I wanna know if there is any way that allows me to view those changes I made?
When I change the code in Print Program, print-out includes this update (although it still informs me that is a copy version). But when I make changes in the SAPScript form (for example, adding a variable for display), <b>it will not update this</b>?
What's problem?
Thank you guys. -
Triggering print program for shipment creation
Hi All,
I have created a new print output type 'ZEDF',which should ideally generate a spool at the time of saving the shipment. But unfortunately, this is not happening.Whenever I save a newly created shipment,this output type is not getting triggered,but when I repeat the same output type through VT02,a spool is generated automatically.I have maintained all the condition records properly in the system. Please help me on this.
Thank you,
ArchanaHi,
Have you checked the settings in NACE tcode?
Pls check the same and amde the configuration according to your Device Type.. Pls have a look on below points.
Hi,
1. Goto in NACE
2. You need to ask your functional buddy to let you know about Application area, I suppose u need to take EF.
3. Select EF from the list and than click on Output Types, select any output type (Which you wud like to give to your script)
4. Else if you like to create a new one for your script, then on same screen click on change button, then click on New Entries
And give all the detailed info.
5. To use existing output types, select a output type like "ZEDI", at the left hand side double click on Processing Routines.
6. In the Processing Routines block , Give the Program name as print program and here you need to give your SAP scrip name in Form option.
save it.
Regards,
Lokesh. -
Finding Program for triggering Print Program (MIGO - Goods Receipt)
Hi all,
Currently, I have developed customized print program and SMARTFORMS for Goods Receipt via MIGO, with output type ZZGR.
Typically, this is a inter-plant transfer, where Plant A will issue a Delivery Order to Plant B, and Plant B will post goods receipt via MIGO (Movement Type 101), using Delivery Order number. As soon as the Material Document is posted, the SMARTFORMS shall be triggered by customized print program, in order to print out the goods receipt document upon material doc posted.
The config for output determination (via TCODE NACE) for goods receipt is configured. I have tested post a goods receipt using Delivery Order, and Material Document is posted successfully. However, I got a message from SAP Inbox (Businees Area), saying that my Material Document having an update error, and the root cause is specifically from calling Function Module to trigger Smartforms in the print program. From tcode ST22, I realized that the error is due to empty parameter being passed to the function module (where the parameter is required field for further processing in Smartform).
In order to rectify why empty parameter is bieng passed, I will have to debug the print program, after GR posted from MIGO. Therefore, can someone shed some lights on how to perform a debugging process, or any standard sap program involved, as I understand that the print program is triggered (in background) after GR posted?
Also, can I know why the Material Document will not be committed to MKPF table after GR posted, is it due to the update error from the above mentioned?
Many thanks.
Best regards,
Patrick
P/S: I'm using SAP ECC6.Actually, this print program is being triggered in the update processing.
Put a breakpoint in your driver program.
In MIGO, before pressing the SAVE button start debugging.
Press the SAVE button.
Start the update debugging by Settings > Update Debugging.
As soon as you continue in debugging, it would open another debugging session for the Update debugging. You can press continue and it would stop at your breakpoint.
Regards,
Naimesh Patel -
Purchase order print program error
hi experts!
am facing a problem in my purchase order print program. the problem is that when i am trying to see the print preview the following dump error is throughing, which am not able to understand.
the P.O total amount should be change into words( like one million then thousand thirty three kuwait dinars)
but the total amount is not converting into as mentioned, instead the dump is encountered.
please give me solution,
thnaks
*DUMP*
Runtime Errors CONVT_NO_NUMBER
Exception CX_SY_CONVERSION_NO_NUMBER
Date and Time 05.05.2008 19:04:43
Short text
Unable to interpret "1760,778.71 " as a number.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZMM_SUBROUTINES" had to be terminated because it has
come across a statement that unfortunately cannot be executed.
What can you do?
Note down which actions and inputs caused the error.
To process the problem further, contact you SAP system
administrator.
Using Transaction ST22 for ABAP Dump Analysis, you can look
at and manage termination messages, and you can also
keep them for a long time.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not
caught in
procedure "GET_AMT_IN_WORDS" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The program attempted to interpret the value "1760,778.71 " as a number, but
since the value contravenes the rules for correct number formats,
this was not possible.
How to correct the error
Whole numbers are represented in ABAP as a sequence of numbers, possibly
with an algebraic sign.
The following are the possibilities for the representation of floating
point numbers:
[algebraic sign][mantissa]E[algebraic sign][exponent]
[algebraic sign][whole number part].[fraction part]
For example, -12E+34, +12E-34, 12E34, 12.34
If the error occurred in your own ABAP program or in an SAP
program you modified, try to remove the error.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"CONVT_NO_NUMBER" "CX_SY_CONVERSION_NO_NUMBER"
"ZMM_SUBROUTINES" or "ZMM_SUBROUTINES"
"GET_AMT_IN_WORDS"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
The exception must either be prevented, caught within proedure
"GET_AMT_IN_WORDS" "(FORM)", or its possible occurrence must be declared in the
RAISING clause of the procedure.
To prevent the exception, note the following:
System environment
SAP-Release 700
Application server... "EHPAP1"
Network address...... "10.100.150.103"
Operating system..... "AIX"
Release.............. "5.3"
Hardware type........ "00C3B3F04C00"
Character length.... 16 Bits
Pointer length....... 64 Bits
Work process number.. 1
Shortdump setting.... "full"
Database server... "EHPDB"
Database type..... "DB6"
Database name..... "EHP"
Database user ID.. "SAPEHP"
Char.set.... "C"
SAP kernel....... 700
created (date)... "Mar 19 2007 20:40:49"
create on........ "AIX 2 5 005DD9CD4C00"
Database version. "DB6_81 "
Patch level. 102
Patch text.. " "
Database............. "DB6 08.02., DB6 09."
SAP database version. 700
Operating system..... "AIX 1 5, AIX 2 5, AIX 3 5"
Memory consumption
Roll.... 16192
EM...... 29328936
Heap.... 0
Page.... 1359872
MM Used. 19180992
MM Free. 1764848
User and Transaction
Client.............. 400
User................ "FADISULAIMAN"
Language key........ "E"
Transaction......... "ME22N "
Program............. "ZMM_SUBROUTINES"
Screen.............. "SAPLMEGUI 0014"
Screen line......... 22
Information on where terminated
Termination occurred in the ABAP program "ZMM_SUBROUTINES" - in
"GET_AMT_IN_WORDS".
The main program was "RM_MEPO_GUI ".
In the source code you have the termination point in line 398
of the (Include) program "ZMM_SUBROUTINES".
The termination is caused because exception "CX_SY_CONVERSION_NO_NUMBER"
occurred in
procedure "GET_AMT_IN_WORDS" "(FORM)", but it was neither handled locally nor
declared
in the RAISING clause of its signature.
The procedure is in program "ZMM_SUBROUTINES "; its source code begins in line
358 of the (Include program "ZMM_SUBROUTINES ".
Source Code Extract
Line SourceCde
368 DATA: lt_spell LIKE spell.
369
370 READ TABLE in_tab WITH KEY 'CURR'.
371 IF sy-subrc = 0.
372 lf_curr = in_tab-value.
373 ENDIF.
374
375 READ TABLE in_tab WITH KEY 'NETWR'.
376 IF sy-subrc = 0.
377 lf_netpr_01 = in_tab-value.
378 REPLACE ',' IN lf_netpr_01 WITH ' '.
379 CONDENSE lf_netpr_01 NO-GAPS.
380
381 IF lf_curr = 'KWD'.
382 lf_netpr_kwd = lf_netpr_01.
383
384 CALL FUNCTION 'SPELL_AMOUNT'
385 EXPORTING
386 amount = lf_netpr_kwd
387 currency = lf_curr
388 filler = ''
389 language = sy-langu
390 IMPORTING
391 in_words = lt_spell
392 EXCEPTIONS
393 not_found = 1
394 too_large = 2
395 OTHERS = 3.
396
397 ELSE.
>>>>> lf_netpr = lf_netpr_01.
399 CALL FUNCTION 'SPELL_AMOUNT'
400 EXPORTING
401 amount = lf_netpr
402 currency = lf_curr
403 filler = ''
404 language = sy-langu
405 IMPORTING
406 in_words = lt_spell
407 EXCEPTIONS
408 not_found = 1
409 too_large = 2
410 OTHERS = 3.
411 ENDIF.
412 IF sy-subrc <> 0.
413 * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
414 * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
415
416 ELSE.
417
Contents of system fields
Name Val.
SY-SUBRC 0
SY-INDEX 17
SY-TABIX 1
SY-DBCNT 18
SY-FDPOS 1
SY-LSIND 0
SY-PAGNO 0
SY-LINNO 1
SY-COLNO 1
SY-PFKEY NORMAL
SY-UCOMM PREVOUTPUT
SY-TITLE Held Imp. Pur. O r - ESG 5000000021 Created by Fadi Sulaiman
SY-MSGTY A
SY-MSGID TD
SY-MSGNO 426
SY-MSGV1 NEXTPAGE
SY-MSGV2 ZMEDRUCK_PO
SY-MSGV3
SY-MSGV4
SY-MODNO 0
SY-DATUM 20080505
SY-UZEIT 190441
SY-XPROG SAPCNVE
SY-XFORM CONVERSION_EXITHi Prasad,
Check the FM's
SPELL_AMOUNT --> for display in millions
HR_IN_CHG_INR_WRDS --> for display in lakhs and crores -
Handling Output in the print program
All,
I have the following issue.
We are having a single custom smartform for printing purchase order used for printing for 32 company codes, Because of this smartform has been tide up with lot of "Conditions"
Now we wanted to split this smartform based on regions ie Americana, APEC, Europe, ME & Africa.
But the problem is this Smartform has been currently called using a single output type.
So if we created 4 copy of this Smartform (1 for each region), we don't wanted to create 4 new output types for calling these forms according to the region.
So we are thinking creating a custom table contains the region code and smartform name. so in the print program we are going to read this table and get the smartform and go for priting.
Is anybody come across this kind of problem. Is any other better options available to handle this?
PS: I feel this is not smartform issue. that's why i created under general abap. Moderators are agree with this
a®I faced this situation before and we used <generic_sf_name>_US , <generic_sf_name>_EU etc... and handled it in the print program
case.
when CON1.
when CON2.
endcase.
call function 'lv_name' ... -
Script Print Program Logic.......
Hi All
This is the print program of my script, i am not getting the logic..can any body help me with this..
INCLUDE rvadtabl.
TABLES: vbuk, "Vertriebsbeleg (Kopf)-Status
vbco3, "Schlüsselfelder Vertriebsbeleg
vbpla, "Allgemeine Transportdaten
vbplk, "Versandelement Kopfdaten
vbplp, "Versandelement Positionsdaten
vbpls, "Verpackung Summendaten
vekp,
adrc,
vbfa. "DEVK937590
TABLES: vbkd. "DEVK942078
*DEVK9A0EB4 - Add define
TYPES:
ty_itcsy TYPE STANDARD TABLE OF itcsy.
start of change for DEVK937590
DATA: BEGIN OF t_deliveryflow OCCURS 0, "VBFA delivery flow
vbeln LIKE vbfa-vbeln, "Subsequent sales and distribu
END OF t_deliveryflow.
DATA: v_lin TYPE i.
CONSTANTS: c_x(1) TYPE c VALUE 'X'.
end of change for DEVK937590
DATA: BEGIN OF xvbplk OCCURS 10.
INCLUDE STRUCTURE vbplk.
DATA: END OF xvbplk.
DATA : BEGIN OF vbdkl OCCURS 10.
INCLUDE STRUCTURE vbdkl.
DATA : END OF vbdkl.
DATA: BEGIN OF tvbdpl OCCURS 0. "Internal table for items
INCLUDE STRUCTURE vbdpl.
DATA: END OF tvbdpl.
DATA: BEGIN OF xvbplp OCCURS 50.
INCLUDE STRUCTURE vbplp.
DATA: END OF xvbplp.
DATA: BEGIN OF xvbpls OCCURS 10.
INCLUDE STRUCTURE vbpls.
DATA: END OF xvbpls.
DATA: retcode LIKE sy-subrc.
DATA: xscreen(1) TYPE c. "Ausgabe auf Drucker oder Bildschirm
DATA: t_vepo LIKE vepo OCCURS 0 WITH HEADER LINE, "VEPO internal table
BEGIN OF t_cartons OCCURS 0, "Internal table for cartons
venum LIKE vepo-venum, "Shipping unit # for carton
END OF t_cartons,
BEGIN OF t_boxes OCCURS 0, "Internal table for BOXES
venum LIKE vepo-venum, "Shipping unit # for BOXES
laeng LIKE vekp-laeng,
breit LIKE vekp-breit,
hoehe LIKE vekp-hoehe,
meabm LIKE vekp-meabm,
END OF t_boxes,
BEGIN OF t_pack_dim OCCURS 0,
laeng LIKE vekp-laeng,
breit LIKE vekp-breit,
hoehe LIKE vekp-hoehe,
meabm LIKE vekp-meabm,
box_qty TYPE i,
END OF t_pack_dim,
v_venum LIKE vepo-venum, "Shipping unit number
i_cartons TYPE i, "# of cartons (Integer type)
i_boxes TYPE i, "# of boxes (Integer type)
i_box_count TYPE i, "# of boxes/carton "DEVK926768
c_cartons(4) TYPE c, "# of cartons (Character type)
c_boxes(4) TYPE c, "# of boxes (Character type)
c_bolnr(35) TYPE c,
v_tel_number LIKE adrc-tel_number,
v_adrnr LIKE adrc-addrnumber,
v_kdmat LIKE lips-kdmat,
v_btgew LIKE likp-btgew,
v_gewei LIKE likp-gewei,
v_arktx LIKE lips-arktx.
******DEVK9A0IK7 Addition by RAMARAJG Starts here
types : BEGIN OF t_item ,
posnr1 type vbplp-posnr,
material1 TYPE mara-matnr,
brgew1 type vbplp-brgew,
vemeh1 type vbplp-vemeh,
item_weight1 TYPE n,
arktx1 type vbplp-arktx,
vboxcnt type n,
end of t_item.
*types : BEGIN OF t_item1 ,
posnr1 type vbplp-posnr,
material1 TYPE mara-matnr,
vemng1 type vbplp-brgew,
vemeh1 type vbplp-vemeh,
item_weight1 TYPE n,
arktx1 type vbplp-arktx,
v_boxcnt type n,
end of t_item1.
DATA: it_item TYPE TABLE OF t_item,
wa_item TYPE t_item.
data: it_item1 type table of t_item,
wa_item1 type t_item.
*data: wa_itab1 like itab1.
data: v_grwt type lips-brgew, "Gross Weight in KG
v_gunit type likp-gewei, "Gross Weight Unit
v_netwt type lips-ntgew, "Net Weight
v_unit type likp-gewei. "Net Weight Unit
v_tboxes type i,
******DEVK9A0IK7 Addition by RAMARAJG ends here
A. Nachricht (allgemein) *
FORM entry USING return_code us_screen.
CLEAR retcode.
xscreen = us_screen.
PERFORM processing USING us_screen.
IF retcode NE 0.
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDFORM. "entry
FORM PROCESSING *
--> PROC_SCREEN *
FORM processing USING proc_screen.
PERFORM get_data. " <-- speziell
PERFORM form_open USING proc_screen vbpla-land1.
CHECK retcode = 0.
PERFORM shipping_point_tel_no.
PERFORM boxes_and_cartons.
PERFORM gross_weight.
***********DEVK9A0IK7 starts here
*******Perform to get the Net weight
*******Perform to get Total weight for each line item
Perform net_weight. "DEVK9A0IK7
Perform Total_weight. "DEVK9A0IK7
***********DEVK9A0IK7 ends here
PERFORM bill_of_lading.
CHECK retcode = 0.
PERFORM check_repeat.
PERFORM text_print. " <-- speziell
begin shb
PERFORM get_end_customer_po.
*end shb
PERFORM packing_dimensions.
PERFORM remarks.
CHECK retcode = 0.
PERFORM form_close.
CHECK retcode = 0.
ENDFORM. "processing
FORM FORM_OPEN *
--> US_SCREEN *
--> US_COUNTRY *
FORM form_open USING us_screen us_country.
INCLUDE rvadopfo.
ENDFORM. "form_open
FORM FORM_CLOSE *
FORM form_close.
CALL FUNCTION 'CLOSE_FORM' "...Ende Formulardruck
EXCEPTIONS OTHERS = 1.
IF sy-subrc NE 0.
retcode = 1.
PERFORM protocol_update.
ENDIF.
SET COUNTRY space.
ENDFORM. "form_close
FORM CHECK_REPEAT *
FORM check_repeat.
SELECT * INTO *nast FROM nast WHERE kappl = nast-kappl
AND objky = nast-objky
AND kschl = nast-kschl
AND spras = nast-spras
AND parnr = nast-parnr
AND parvw = nast-parvw
AND nacha BETWEEN '1' AND '4'.
CHECK *nast-vstat = '1'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'REPEAT'
window = 'REPEAT'
EXCEPTIONS
element = 1
window = 2.
IF sy-subrc NE 0.
PERFORM protocol_update.
ENDIF.
EXIT.
ENDSELECT.
ENDFORM. "check_repeat
FORM PROTOCOL_UPDATE *
FORM protocol_update.
CHECK xscreen = space.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = syst-msgid
msg_nr = syst-msgno
msg_ty = syst-msgty
msg_v1 = syst-msgv1
msg_v2 = syst-msgv2
msg_v3 = syst-msgv3
msg_v4 = syst-msgv4
EXCEPTIONS
OTHERS = 1.
ENDFORM. "protocol_update
B. Packliste (speziell) *
Die Verpackung von Lieferungen wird durch Versandelemente (VSE)
realisiert. Technisch ist ein Versandelement ein Beleg mit Kopf-
und Positionsdaten (Strukturen VBPLK/XVBPLK und VBPLP/XVBPLP).
Eine Position in einem VSE ist entweder wieder ein VSE oder Teil
eine Lieferposition (also mit den zum VSE gehörenden Materialen/
Versandhilftsmitteln verpackt). Der Zusammenhang zur Lieferung
wird durch die beiden Felder VBELN (Lieferung) und POSNR (Position)
in der Struktur VBPLP realisiert. Es ist zu beachten, daß ein VSE
keine Positionsdaten enthalten muß: Die Lieferung wurde dann nicht
vollständig verpackt.
Mathematisch gesehen stellen die VSE einen Wald (aus Bäumen) dar.
An den Knoten können noch Lieferpositionsdaten hängen. Um zu
erkennen ob ein Knoten eine Wurzel oder (und) ein Blatt ist, gibt
es im VSE-Kopf Kennzeichen. Ist KZOBE gesetzt, so ist das VSE ein
oberes Element, also eine Wurzel. Ist KZUNT gesetzt, stellt das VSE
ein unteres Element dar, also ein Blatt. Ist keines der beiden
Kennzeichen gesetzt dann ist das VSE ein innerer Knoten. Es ist
zu beachten, daß beiden Kennzeichen gesetzt sein können: Der Baum
besteht aus einem Knoten. Die Tiefe eines Knotens durch das Feld
TIVEL gegeben.
Weiterhin ist der Baum doppelt verkettet. Es ist also möglich,
nicht nur einen Weg von der Wurzel (eines Teilbaums) zu einem
Blatt zu finden, sondern auch umgekehrt von einem Blatt zur Wurzel
zu gelangen. Dazu existiert (im VSE-Kopf) das Feld UEVEL, also
das übergeordnete VSE.
Um schließlich zu entscheiden, ob ein VSE-Position ein VSE oder
eine Lieferposition ist, wird das Feld POSNR ausgewertet. Ist
das Feld initial, stellt die Position ein VSE dar, im anderen Fall
enthält es die Lieferposition. Ist die Position ein VSE, steht im
Feld UNVEL das zugehörige untergeordnete VSE.
FORM get_data.
vbco3-vbeln = nast-objky.
vbco3-spras = nast-spras.
vbco3-kunde = nast-parnr.
vbco3-parvw = nast-parvw.
*mod+
CALL FUNCTION 'RV_DELIVERY_PRINT_VIEW'
EXPORTING
comwa = vbco3
IMPORTING
kopf = vbdkl
TABLES
pos = tvbdpl.
CALL FUNCTION 'SD_PACKING_PRINT_VIEW'
EXPORTING
comwa = vbco3
IMPORTING
vbpla_wa = vbpla
TABLES
vbplk_tab = xvbplk
vbplp_tab = xvbplp
vbpls_tab = xvbpls
EXCEPTIONS
OTHERS = 01.
LOOP AT xvbplk WHERE kzobe = 'X'.
EXIT.
ENDLOOP.
IF sy-subrc > 0.
syst-msgid = 'VL'.
syst-msgno = '490'.
syst-msgty = 'E'.
PERFORM protocol_update.
retcode = 1.
ENDIF.
ENDFORM. "get_data
FORM TEXT_PRINT *
FORM text_print.
Die Kopfdaten werden implizit ausgegeben, ...
... dann die Überschriften der Positionen ...
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'HEADER'
type = 'TOP'.
... und schließlich die Positionen ausgeben ...
LOOP AT xvbplk WHERE kzobe = 'X'.
PERFORM packing_tree USING xvbplk-venum.
ENDLOOP.
ENDFORM. "text_print
Rekursive Prozedur
FORM packing_tree USING value(shenr).
Daten des Versandelements shenr ausgeben, also Wurzel des Teilbaums
MOVE space TO xvbplk.
xvbplk-venum = shenr.
READ TABLE xvbplk.
vbplk = xvbplk.
READ TABLE t_cartons WITH KEY venum = vbplk-venum.
IF sy-subrc = 0.
IF vbplk-brgew <> 0.
PERFORM set_textsymbol USING '&CARTON_WEIGHT&'
vbplk-brgew.
ELSE.
PERFORM set_textsymbol USING '&CARTON_WEIGHT&'
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'SHELEM'.
ENDIF.
Nun die Positionen abarbeiten (Teilbäume durchlaufen).
Hier wäre eventuell ein Sortierung zwischen Lieferpositionen
und weiteren Versandelementen sinnvoll. Alle nachgeordneten
Positionen liegen eine Stufe tiefer.
LOOP AT xvbplp WHERE venum = shenr.
IF xvbplp-posnr IS INITIAL.
Versandelement
PERFORM packing_tree USING xvbplp-unvel.
ELSE.
Lieferposition (Anteil)
vbplp = xvbplp.
PERFORM customer_material.
***ramarajg starts.
perform item_list.
***ramarajg end.
IF vbplp-brgew <> 0.
PERFORM set_textsymbol USING '&ITEM_WEIGHT&'
vbplp-brgew.
ELSE.
PERFORM set_textsymbol USING '&ITEM_WEIGHT&'
ENDIF.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'DELPOS'.
ENDIF.
ENDLOOP.
***ramarajg starts.
perform TOTAL_WEIGHT.
loop at it_item into wa_item.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'ITEMPOS'.
endloop.
break ramarajg.
***ramarajg end.
ENDFORM. "packing_tree
FORM SET_TEXTSYMBOL *
FORM set_textsymbol USING text_symbol
text_value.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
EXPORTING
name = text_symbol
value = text_value.
ENDFORM. "set_textsymbol
*& Form BOXES_AND_CARTONS
text
--> p1 text
<-- p2 text
FORM boxes_and_cartons.
CLEAR: t_cartons,
t_boxes,
i_cartons,
i_boxes.
REFRESH: t_cartons,
t_boxes.
start of change for DEVK937590
CLEAR t_deliveryflow[].
SELECT vbeln
FROM vbfa
INTO CORRESPONDING FIELDS OF TABLE t_deliveryflow
WHERE vbelv = vbpla-vbeln AND vbtyp_n = c_x.
Select data
DESCRIBE TABLE t_deliveryflow LINES v_lin.
CHECK v_lin GT 0.
SELECT venum vbeln
FROM vepo
INTO CORRESPONDING FIELDS OF TABLE t_vepo
FOR ALL ENTRIES IN t_deliveryflow
WHERE venum = t_deliveryflow-vbeln.
SELECT VENUM
VBELN
FROM VEPO
INTO CORRESPONDING FIELDS OF TABLE T_VEPO
WHERE VBELN = VBPLA-VBELN.
end of change for DEVK937590
SORT t_vepo BY venum.
DELETE ADJACENT DUPLICATES FROM t_vepo COMPARING venum.
Determine the number of cartons and boxes to be shipped.
To determine the number of cartons, shipping unit number (VENUM) is
checked if it a lower-level shipping unit. This is done by reading
table VEPO and checking if VENUM exist in UNVEL (Lower-level shipping
unit). If it does, this means that VENUM is contained within
another container. If it does not exist, it is considered the highest
level of packing for that specific delivery.
LOOP AT t_vepo.
check if VENUM is a lower level shipping unit.
SELECT SINGLE venum INTO v_venum
FROM vepo
WHERE unvel = t_vepo-venum.
If shipping unit number is found, count as carton.
IF sy-subrc = 0.
check if carton already exist for the carton.
READ TABLE t_cartons WITH KEY venum = v_venum.
if carton does not exist, append table
IF sy-subrc <> 0.
t_cartons-venum = v_venum.
APPEND t_cartons.
ENDIF.
ENDIF.
ENDLOOP.
count boxes and cartons
DESCRIBE TABLE t_vepo LINES i_boxes.
DESCRIBE TABLE t_cartons LINES i_cartons.
Convert cartons and boxes field values to CHARACTER type FORMAT.
In order to save the output values to the output fields, the
fields are converted to CHARACTER type formats.
MOVE: i_cartons TO c_cartons,
i_boxes TO c_boxes.
PERFORM set_textsymbol USING '&BOXES&'
c_boxes.
PERFORM set_textsymbol USING '&CARTONS&'
c_cartons.
ENDFORM. " BOXES_AND_CARTONS
*& Form BILL_OF_LADING
text
--> p1 text
<-- p2 text
FORM bill_of_lading.
SELECT SINGLE bolnr
FROM likp
INTO c_bolnr
WHERE vbeln = vbpla-vbeln.
PERFORM set_textsymbol USING '&BILL_OF_LADING&'
c_bolnr.
ENDFORM. " BILL_OF_LADING
*& Form PACKING_DIMENSIONS
text
--> p1 text
<-- p2 text
FORM packing_dimensions.
CLEAR: T_BOXES,
T_PACK_DIM.
REFRESH: T_BOXES,
T_PACK_DIM.
SELECT VENUM
LAENG
BREIT
HOEHE
MEABM
FROM VEKP
INTO CORRESPONDING FIELDS OF TABLE T_BOXES
FOR ALL ENTRIES IN T_VEPO
WHERE VENUM = T_VEPO-VENUM.
LOOP AT T_BOXES.
READ TABLE T_PACK_DIM WITH KEY LAENG = T_BOXES-LAENG
BREIT = T_BOXES-BREIT
HOEHE = T_BOXES-HOEHE
MEABM = T_BOXES-MEABM.
IF SY-SUBRC = 0.
T_PACK_DIM-BOX_QTY = T_PACK_DIM-BOX_QTY + 1.
MODIFY T_PACK_DIM INDEX SY-TABIX.
ELSE.
T_PACK_DIM-LAENG = T_BOXES-LAENG.
T_PACK_DIM-BREIT = T_BOXES-BREIT.
T_PACK_DIM-HOEHE = T_BOXES-HOEHE.
T_PACK_DIM-MEABM = T_BOXES-MEABM.
T_PACK_DIM-BOX_QTY = 1.
APPEND T_PACK_DIM.
ENDIF.
ENDLOOP.
LOOP AT T_PACK_DIM.
AT FIRST.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'PACKING_DIMENSIONS_HEADER'.
ENDAT.
CLEAR: VEKP,
C_BOXES.
VEKP-LAENG = T_PACK_DIM-LAENG.
VEKP-BREIT = T_PACK_DIM-BREIT.
VEKP-HOEHE = T_PACK_DIM-HOEHE.
VEKP-MEABM = T_PACK_DIM-MEABM.
MOVE: T_PACK_DIM-BOX_QTY TO C_BOXES.
PERFORM SET_TEXTSYMBOL USING '&BOX_QTY&'
C_BOXES.
IF VEKP-LAENG <> 0 AND
VEKP-BREIT <> 0 AND
VEKP-HOEHE <> 0.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'PACKING_DIMENSIONS'.
ENDIF.
ENDLOOP.
ENDFORM. " PACKING_DIMENSIONS
*& Form REMARKS
text
--> p1 text
<-- p2 text
FORM remarks.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'REMARKS'.
ENDFORM. " REMARKS
*& Form SHIPPING_POINT_TEL_NO
text
--> p1 text
<-- p2 text
FORM shipping_point_tel_no.
SELECT SINGLE adrnr
FROM tvst
INTO v_adrnr
WHERE vstel = vbpla-vstel.
SELECT SINGLE tel_number
FROM adrc
INTO adrc-tel_number
WHERE addrnumber = v_adrnr.
ENDFORM. " SHIPPING_POINT_TEL_NO
*& Form CUSTOMER_MATERIAL
text
--> p1 text
<-- p2 text
FORM customer_material.
CLEAR: v_kdmat.
begin of mod*
IF vbdkl-lfart = 'LO'.
SELECT SINGLE kdmat postx
INTO (v_kdmat , v_arktx)
FROM knmt
WHERE vkorg = vbdkl-vkorg
AND vtweg = '01'
AND kunnr = vbdkl-kunag
AND matnr = vbplp-matnr.
IF NOT v_kdmat IS INITIAL.
vbplp-matnr = v_kdmat.
vbplp-arktx = v_arktx.
ENDIF.
ELSE.
SELECT SINGLE kdmat
FROM lips
INTO v_kdmat
WHERE vbeln = vbplp-vbeln AND
posnr = vbplp-posnr AND
matnr = vbplp-matnr.
ENDIF.
**ramarajg
IF v_kdmat <> ' '.
PERFORM set_textsymbol USING '&MATERIAL&'
v_kdmat.
ELSE.
PERFORM set_textsymbol USING '&MATERIAL&'
vbplp-matnr.
ENDIF.
ENDFORM. " CUSTOMER_MATERIAL
FORM ITEM_WEIGHTS *
--> IN_TAB4 *
--> OUT_TAB4 *
FORM item_weights TABLES in_tab4 STRUCTURE itcsy
out_tab4 STRUCTURE itcsy.
DATA: n_vbeln(10) TYPE n,
v_btgew LIKE likp-btgew,
v_ntgew1 LIKE vekp-ntgew,
v_btgew1 LIKE likp-btgew,
v_ntgew2 LIKE likp-ntgew,
v_btgew2 LIKE likp-btgew,
BEGIN OF t_venum OCCURS 0,
venum LIKE vepo-venum,
END OF t_venum.
READ TABLE in_tab4 INDEX 1.
CHECK sy-subrc = 0.
MOVE in_tab4-value TO n_vbeln. "convert to numeric type.
start of change for DEVK937590
*break ramarajg.
CLEAR t_deliveryflow[].
SELECT vbeln
FROM vbfa
INTO CORRESPONDING FIELDS OF TABLE t_deliveryflow
WHERE vbelv = n_vbeln AND vbtyp_n = c_x.
Select data
DESCRIBE TABLE t_deliveryflow LINES v_lin.
CHECK v_lin GT 0.
SELECT venum
FROM vepo
INTO CORRESPONDING FIELDS OF TABLE t_venum
FOR ALL ENTRIES IN t_deliveryflow
WHERE venum = t_deliveryflow-vbeln.
SELECT VENUM
FROM VEPO
INTO CORRESPONDING FIELDS OF TABLE T_VENUM
WHERE VBELN = N_VBELN.
end of change for DEVK937590
CLEAR v_btgew.
DESCRIBE TABLE t_venum LINES v_lin. "DEVK937590
CHECK v_lin GT 0. "DEVK937590
SELECT ntgew
FROM vekp
INTO v_btgew
FOR ALL ENTRIES IN t_venum
WHERE venum = t_venum-venum.
v_btgew1 = v_btgew1 + v_btgew.
ENDSELECT.
SELECT SUM( ntgew )
FROM lips
INTO v_ntgew1
WHERE vbeln = n_vbeln.
SELECT SINGLE ntgew
btgew
FROM likp
INTO (v_ntgew2, v_btgew2)
WHERE vbeln = n_vbeln.
IF v_ntgew1 = v_ntgew2 AND
v_btgew1 = v_btgew2.
READ TABLE out_tab4 WITH KEY name = 'PRINT_WEIGHT'.
IF sy-subrc = 0 .
out_tab4-value = 'X'.
ELSE.
out_tab4-value = ' '.
ENDIF.
MODIFY out_tab4 INDEX sy-tabix.
ENDIF.
ENDFORM. "item_weights
*& Form GROSS_WEIGHT
text
--> p1 text
<-- p2 text
FORM gross_weight.
CLEAR: v_btgew.
SELECT SINGLE btgew
gewei
FROM likp
INTO (v_btgew, v_gewei)
WHERE vbeln = vbpla-vbeln.
PERFORM set_textsymbol USING '&GROSS_WEIGHT&'
v_btgew.
PERFORM set_textsymbol USING '&GROSS_WEIGHT_UNIT&'
v_gewei.
changes added by RAMARAJG starts here
clear v_grwt.
clear v_gunit.
v_grwt = v_btgew.
v_gunit = v_gewei.
if v_gunit = 'G'.
v_grwt = v_grwt / 1000.
v_gunit = 'KG'.
endif.
PERFORM set_textsymbol USING '&GROSS_WEIGHT1&'
v_grwt.
PERFORM set_textsymbol USING '&GROSS_WEIGHT_UNIT1&'
v_gunit.
changes added by RAMARAJG ends here
ENDFORM. " GROSS_WEIGHT
*& Form GET_END_CUSTOMER_PO
Retrieve End Customer PO#
--> p1 text
<-- p2 text
FORM get_end_customer_po.
DATA: v_zvgbel LIKE lips-vgbel.
DATA v_bstkd_e TYPE bstkd_e.
CLEAR: v_bstkd_e, v_zvgbel.
SELECT SINGLE vgbel INTO v_zvgbel
FROM lips
WHERE vbeln = vbpla-vbeln.
SELECT SINGLE bstkd_e INTO v_bstkd_e
FROM vbkd
WHERE vbeln = v_zvgbel
AND bstkd_e > ''.
PERFORM set_textsymbol USING '&V_BSTKD_E&'
v_bstkd_e.
ENDFORM. " GET_END_CUSTOMER_PO
*DEVK9A0EB4 - Add a form
*& Form shipper_acct
Get shipper account at customer
FORM shipper_acct TABLES in_tab1 TYPE ty_itcsy
out_tab1 TYPE ty_itcsy.
DATA: v_kunag TYPE likp-kunag, " Sold to party
v_eikto TYPE knvv-eikto. "Shipper account number at customer
DATA v_strlen(10) TYPE c.
DATA wa_tab1 TYPE itcsy.
DATA n_vbeln(10) TYPE n.
Get kunnr from likp
CLEAR wa_tab1.
READ TABLE in_tab1 INTO wa_tab1 WITH KEY name = 'VBPLA-VBELN'.
IF sy-subrc = 0.
n_vbeln = vbpla-vbeln.
ENDIF.
CHECK sy-subrc = 0.
SELECT kunag
FROM likp
INTO v_kunag
WHERE vbeln = n_vbeln.
ENDSELECT.
IF sy-subrc = 0.
Get shipper account
SELECT eikto INTO v_eikto
FROM knvv
WHERE kunnr = v_kunag.
ENDSELECT.
IF sy-subrc = 0.
*append the field to the out_tab1 printing output
wa_tab1-name = 'VKNN-EIKTO'.
wa_tab1-value = v_eikto.
APPEND wa_tab1 TO out_tab1.
ENDIF.
ENDIF.
ENDFORM. "shipper_acct
***********DEVK9A0IK7 starts here
*& Form net_weight
text
--> p1 text
<-- p2 text
form net_weight .
CLEAR: v_btgew.
SELECT SINGLE ntgew
gewei
FROM likp
INTO (v_netwt, v_unit)
WHERE vbeln = vbpla-vbeln.
if v_unit = 'G'.
v_netwt = v_netwt / 1000.
v_unit = 'KG'.
endif.
PERFORM set_textsymbol USING '&NET_WEIGHT&'
v_netwt.
PERFORM set_textsymbol USING '&NET_WEIGHT_UNIT&'
v_unit.
endform. " net_weight
***********DEVK9A0IK7 ends here
*& Form item_list
text
--> p1 text
<-- p2 text
form item_list.
move vbplp-posnr to wa_item-posnr1.
*move material to wa_itab1-material1.
move vbplp-brgew to wa_item-brgew1.
move vbplp-vemeh to wa_item-vemeh1.
*move item_weight to wa_itab1-item_weight1.
*move gross_weight_unit to wa_itab1-gross_weight_unit1.
move v_arktx to wa_item-arktx1.
if v_kdmat <> ' '.
move v_kdmat to wa_item-material1.
else.
move vbplp-matnr to wa_item-material1.
endif.
wa_item-vboxcnt = 1.
append wa_item TO it_item.
CLEAR : wa_item1, wa_item.
it_item1[] = it_item[].
REFRESH it_item[].
break-point.
endform. " item_list
*& Form TOTAL_WEIGHT
text
--> p1 text
<-- p2 text
form TOTAL_WEIGHT .
LOOP AT it_item1 into wa_item1.
READ TABLE it_item INTO wa_item WITH KEY material1 = wa_item1-material1 posnr1 = wa_item1-posnr1.
IF sy-subrc NE 0.
APPEND wa_item1 TO it_item.
ELSE.
wa_item1-brgew1 = wa_item1-brgew1 + wa_item-brgew1.
Wa_item1-vboxcnt = wa_item1-vboxcnt + wa_item-vboxcnt.
MODIFY it_item FROM wa_item1 TRANSPORTING brgew1 vboxcnt
WHERE material1 = wa_item1-material1
AND posnr1 = wa_item1-posnr1.
ENDIF.
ENDLOOP.
endform. " TOTAL_WEIGHTthe Logic to be added is this
b. Remove the carton ID & box ID from the print out, the line item should just print the total delivery quantity, do not split the printing by different box ID or carton ID.
i. Delivery Item= LIPS-POSNR
ii. Delivery Qty for Item = LIPSD-G_LFIMG= LIPSD-PIKMG
c. Add Total Boxes for each item, this should be a calculation field for each material HUMV4-MATNR, count how many handling unit VEKPVB-EXIDV has been used to pack the same material , output the total boxes for each delivery item.
d. Add Gross Weight for each item , retrieve data from LIPS-BRGEW
e. Add Net weight to the print out, below the gross weight retrieve data from LIKP-NTGEW -
Customer Statement using SAP Script and Standard print program RFKORD10
Using sap script and standard print program RFKORD10 I need to create a customer statement where the main window will be as follows
Invoice # InvoiceDate CustomerPO Debit Amt Credit Amt Total
6 7 8 9 10 11
6 7 8 9 10 11
Totals 12 13 14
Where company code BKORM-KUKRS
Invoice BSID-BELNR
Invoice date BSID-BLDAT
Customer PO VBKD-BSTKD
For each document number selected there will be one to many records in VBRP. For each invoice item in VBRP:
u2022 Select BSTKD from VBKD where
o VBELN = VBRP-VGBEL and
o POSNR = VBRP-VGPOS
u2022 If no hits then select BSTKD from VBKD where
o VBELN = VBRP-VGBEL
If there is more than one PO per invoice then list them in the Customer PO field without repeating the other fields.PO shouldnu2019t come more than once per invoice.
Debit Amt if BSEG-SHKZG = S then WRBTR ELSE 0
Credit Amt if BSEG-SHKZG = H then WRBTR ELSE 0
Total Debit Amt u2013 Credit Amt
Totals Subtotals
It will be of great help if some one can help me with the script and the alterations required in standard print program RFKORD10
Points will b rewarded for sure.
Thanks.Hi Suganya,
The custom form is getting displayed properly. But the requirement is to have it as an editable PDF. So the functional team is working on configuring the settings of PDF forms with customers email address.
But for right now, i customized the standard form F140_ACC_STAT_01 and standard print program RFKORD10_PDF and did the configuration. It is getting displayed (I tested only with the transaction FBL5N - customer open line items..)
Please let me know any further details on this.
Poornima -
How to find standard print programs for ADOBE forms
Hi All,
My question is how to find the standard SAP print program for a SAP provided ADOBE form. For example - how to find what is the satndard SAP provided print program for the ADOBE form for payment advice 'F110_AVIS_INT'.
As by default in the transaction F110 (where the payment advice form configuration is done), a SAP Script form is attached and the print program assigned is an SAP Script (as it contains call to function module like open_form, write_form... ) program and not an ADOBE print program.Hi Renu,
I have gone through the link provided by you but it only shows a list of standard PDF forms.
My question was how to find the standard SAP provided print program (or driver program which contains the data fetch logic and passing of the data to the interface of the ADOBE form) for these SAP provided ADOBE form.
If SAP has provided standard ADOBE form then definitely they would also have provided the standard print program too ?
@Srihari,
The path system --> Status --> program SAPLFPUIFB is the standard program for the SFP transaction and not for the payment advice form F110_AVIS_INT.
It will be same for all the ADOBE forms if we check in System --> Status --> Program. -
How to use RLB_INVOICE standard print program
my program is copy of RLB_INVOICE
when i press execute i m not getting any output
how can i see print preview by executing print program.hi,
check this
REPORT ZRE_SD_INVOICE.
*& Form ENTRY
text
-->P_ENT_RETCO text
-->P_ENT_SCREEN text
FORM ENTRY USING P_ENT_RETCO
P_ENT_SCREEN.
DATA: lf_formname TYPE TDSFNAME,
lf_fm_name TYPE RS38L_FNAM,
g_adrnr LIKE ADRC-ADDRNUMBER.
TABLES DECLARATIONS *
TABLES: NAST, "Messages
*NAST, "Messages
TNAPR, "Programs & Forms
ITCPO, "Communicationarea for Spool
ARC_PARAMS, "Archive parameters
TOA_DARA, "Archive parameters
ADDR_KEY, "Adressnumber for ADDRESS
T005U , "FOR RETRIVAL OF STATE
ADRC . "FOR RETRIVAL OF ADDRESS
DATA DECLARATIONS *
DATA: RETCODE LIKE SY-SUBRC. "Returncode
DATA: XSCREEN(1) TYPE C. "Output on printer or screen
DATA: REPEAT(1) TYPE C.
DATA: NAST_ANZAL LIKE NAST-ANZAL. "Number of outputs (Orig. + Cop.)
DATA: NAST_TDARMOD LIKE NAST-TDARMOD. "Archiving only one time
DATA: GF_LANGUAGE LIKE SY-LANGU.
DATA: L_FMNAME TYPE rs38l_fnam.
data: CS_BIL_INVOICE type LBBIL_INVOICE.
data: IS_PRINT_DATA_TO_READ type LBBIL_PRINT_DATA_TO_READ value
'XXXXXXXXXXXXXXXXXXXXXXXX'.
DATA: BILL_DOC_EXP LIKE VBCO3.
DATA: BILL_DOC_IMP_H LIKE VBDKR.
DATA: BILL_DOC_IMP_I LIKE VBDPR OCCURS 0 WITH HEADER LINE.
DATA: T_RC LIKE ADRC OCCURS 0 WITH HEADER LINE.
DATA: T_T00 LIKE T005U OCCURS 0 WITH HEADER LINE.
DATA: L_WERKS LIKE J_1IEXCHDR-WERKS.
DATA: I_LIKP LIKE LIKP OCCURS 0 WITH HEADER LINE,
I_VBAK LIKE VBAK OCCURS 0 WITH HEADER LINE,
I_LIPS LIKE LIPS OCCURS 0 WITH HEADER LINE,
I_VBKD LIKE VBKD OCCURS 0 WITH HEADER LINE,
I_EIKP LIKE EIKP OCCURS 0 WITH HEADER LINE,
I_MARC LIKE MARC OCCURS 0 WITH HEADER LINE,
I_KNA1 LIKE KNA1 OCCURS 0 WITH HEADER LINE,
I_T604T LIKE T604T OCCURS 0 WITH HEADER LINE,
I_KONV LIKE KONV OCCURS 0 WITH HEADER LINE,
I_VBRK LIKE VBRK OCCURS 0 WITH HEADER LINE,
I_VBRP LIKE VBRP OCCURS 0 WITH HEADER LINE.
I_T685T LIKE T685T OCCURS 0 WITH HEADER LINE,
I_KONV1 LIKE KONV OCCURS 0 WITH HEADER LINE.
*types begin of t_vbrp.
*include structure vbrp.
*types grp_counter type i .
*types end of t_vbrp.
*data i_vbrp type standard table of t_vbrp with header line.
*NAST-OBJKY = BILL_DOC .
DATA : inv_code LIKE vbak-vbeln.
BILL_DOC_EXP-SPRAS = 'E'.
BILL_DOC_EXP-VBELN = nast-objky(10).
inv_code = nast-objky(10).
SELECT SINGLE WERKS INTO L_WERKS FROM J_1IEXCHDR WHERE RDOC =
inv_code.
select * from vbrp into table i_vbrp where vbeln = inv_code.
lf_formname = tnapr-sform.
IF L_WERKS = '2000'.
tnapr-sform = 'ZSF_SD_INVOICE'.
ELSE.
tnapr-sform = 'ZSD_FACTORY_EXCISE_INVOICE_PAT'.
ENDIF.
Read print data
CALL FUNCTION 'LB_BIL_INV_OUTP_READ_PRTDATA'
EXPORTING
IF_BIL_NUMBER = NAST-OBJKY
IF_PARVW = NAST-PARVW
IF_PARNR = NAST-PARNR
IF_LANGUAGE = NAST-SPRAS
IS_PRINT_DATA_TO_READ = IS_PRINT_DATA_TO_READ
IMPORTING
ES_BIL_INVOICE = CS_BIL_INVOICE
EXCEPTIONS
RECORDS_NOT_FOUND = 1
RECORDS_NOT_REQUESTED = 2
OTHERS = 3.
GET THE DATA RELATED TO THE BILLING DOCUMENT BASED ON THE BILLING
*DOCUMENT NUMBER
CALL FUNCTION 'RV_BILLING_PRINT_VIEW'
EXPORTING
COMWA = BILL_DOC_EXP
IMPORTING
KOPF = BILL_DOC_IMP_H
TABLES
POS = BILL_DOC_IMP_I
EXCEPTIONS
TERMS_OF_PAYMENT_NOT_IN_T052 = 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.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = tnapr-sform
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = L_FMNAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION L_FMNAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
ITAB_LANDX =
ITAB_ZOLLA =
ITAB_AZOLL =
ITAB_KZGBE =
ITAB_IEVER =
ITAB_LADEL =
ITAB_LANDX50 =
ITAB_VTEXT =
ITAB_EXPVZ =
I_KZABE =
NN_LINES =
S =
D =
I_TOTAL =
I_MAKTG =
I_CAL_NET =
IS_BIL_INVOICE = CS_BIL_INVOICE
IS_KOPF = BILL_DOC_IMP_H
IS_NAST =
IS_REPEAT =
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
I_LIKP = I_LIKP
I_VBAK = I_VBAK
I_LIPS = I_LIPS
I_VBKD = I_VBKD
I_EIKP = I_EIKP
I_MARC = I_MARC
I_KNA1 = I_KNA1
I_T604T = I_T604T
I_KONV = I_KONV
I_VBRK = I_VBRK
I_VBRP = I_VBRP
I_T685T = I_T685T
I_KONV1 = I_KONV1
IS_PO = BILL_DOC_IMP_I
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR ` = 2
SEND_ERROR = 3
USER_CANCELED = 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.
ENDFORM. "ENTRY
Regards
Santosh. -
Contents of a custom print program for a custom smartform
Hi...
Can you please tell me if we are writing a custom print program from scratch for a custom smartform for which there is no standard form available what are all the things that need to be coded in the print program..
My doubts on this are if we are configuring this form for output types of PO purchase order for mediums 1,2, 5 and 6 does any extra coding need to be done in the print program that is related to these mediums or is it just a configuration issue..
Apart from data retrieval part and call the function modules to send the data to smartforms what are the other things that we need to code in a custom smartform.. Anything that we need to code related to printing issues..
It would be great if someone can post a custom print program for any output type valid for mediums 1, 2, 5 and 6.
Also my last doubt is do we need to do anything in SE11 in designing a smartform and in what context do we need it...
Thanks and appreciate your help... Surely will reward for all the helpful answers..
Thanks again..
Kanthi..Hi,
yes you need to create your own print program. You need to catch printing information and to send data to your smartforms.
To send data to your smartforms you need to use structure describe in the data dictionnary.
This is a peace of code for sending information to a smartform that will be print used an external program (Esker)
DATA: it_data LIKE TABLE OF zssf_bl WITH HEADER LINE,
w_formname TYPE tdsfname ,
w_fm_name TYPE rs38l_fnam ,
is_output TYPE ssfcompop ,
is_control TYPE ssfctrlop ,
is_job_out TYPE ssfcresop .
* Récupère le nom du module fonction.
MOVE 'Z_BL_STT' TO w_formname.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = w_formname
IMPORTING
fm_name = w_fm_name
EXCEPTIONS
OTHERS = 3.
* Prépare les paramètres d'impression.
is_output-xsfcmode = 'X'.
is_output-xsf = 'X'.
is_output-xsfoutmode = 'S'.
is_output-xsfoutdev = 'DOCL'.
is_output-xsfformat = 'X'.
is_output-tdnoprev = 'X'.
is_output-tdnoprint = ' '.
is_output-tddest = 'DOCL'.
is_output-tdprinter = 'PLAIN'.
is_output-tdnewid = 'X'.
is_output-tdimmed = 'X'.
is_output-tddelete = 'X'.
is_control-no_dialog = 'X'.
is_control-preview = ' '.
is_control-no_open = 'X'.
is_control-no_close = ' '.
* Prepare le formulaire
CALL FUNCTION 'SSF_OPEN'
EXPORTING
user_settings = ' '
output_options = is_output
control_parameters = is_control
IMPORTING
job_output_options = is_job_out
EXCEPTIONS
OTHERS = 5.
* Appels du formulaire.
CALL FUNCTION w_fm_name
EXPORTING
control_parameters = is_control
output_options = is_output
is_bl = zbl_soustrait
TABLES
it_data = it_data
EXCEPTIONS
OTHERS = 5.
You need to catch information from the NAST table maybe
Rgd
Frédéric -
Adding customer field to selection screen of RFKORD11 - Customer Statement Printing Program:
Hello,
We are required to add an important customer field to selection screen of customer
statement printing program: RFKORD11 for our South African branch.
Please advise us regarding this matter,
is there a proper user-exit or a repair is needed?
Kind Regards.Enhancement
text
F050S001
FIDCMT, FIDCC1,
FIDCC2: Edit user-defined IDoc segment
F050S002
FIDCC1: Change
IDoc/do not send
F050S003
FIDCC2: Change
IDoc/do not send
F050S004
FIDCMT, FIDCC1,
FIDCC2: Change outbound IDoc/do not send
F050S005
FIDCMT, FIDCC1,
FIDCC2 Inbound IDoc: Change FI document
F050S006
FI Outgoing IDoc:
Reset Clearing in FI Document
F050S007
FIDCCH Outbound:
Influence on IDoc for Document Change
F180A001
Balance Sheet
Adjustment
FARC0001
Enhancements within
archiving (FI)
FARC0002
Additional Checks for
Archiving MM Vendor Master Data
FEDI0001
Function exits for
EDI in FI
FICT0001
Exits for
inter-company transactions
RFAVIS01
Customer Exit for
Changing Payment Advice Segment Text
RFBVX001
Enhancement for bank
directory transfer (Austria)
RFEPOS00
Line item display:
Checking of selection conditions
SAPLBANK
User exit: Bank data
SAPLF040
WF: Preliminary
posting (authorized for release)
SAPLF051
Workflow for FI
(pre-capture, release for payment)
SAPLFCPD
One-time account data
or different payee in booking
SAPLSSRV
User exit: Bank
account numbers
RFKORIEX
Automatic
correspondence
please check which one is better . -
Hi All
I have the SAPscript form name. I need to find out the name of the print program.
The table TNAPR gives the standard program name attached to the SAPscript.
But, I need to find out the Z* program name associated with the SAPscript.
Pls do help on this.
Thanks,
Zahabia.hI
Sapscripts are client dependend and smartforms are client independet.
SAPscript are CLient Dependent, SmartForms are Client Independent. The reason why SmartForms are client independent is because when you activate a SMartForm, SAP actually generates a Function Module (which as you know is client independent). The Print Program (or as SAP likes to refer to them these days - Application Program) calls your generated FM.
In the "smartforms" transaction, when you are viewing a smartform, you can go to the Environment->Function Module Name menu path to see the FM name.
Look at the "Application Program" for the Invoice SmartForm (RLB_INVOICE):
determine smartform function module for invoice
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
variant = ' '
direct_call = ' '
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
call smartform invoice
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj =
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = space
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = repeat
importing document_output_info =
job_output_info =
job_output_options =
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Difference with SMARTFORMS vs. SapScript (SE71)
The Following are the differences :-
a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
b) It is possible to have a smartform without a main window .
c) Labels cannot be created in smartforms.
d) Routines can be written in smartforms tool.
e) Smartforms generates a function module when activated.
Contributed by : SAP ABAP/4 Programming, Basis Administration, Configuration Hints and Tips
f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
i) The main difference is that SAP script is client-dependant, while smartform is independent. Also there are some advanced and intreractive features available in smartforms.
You can use an External subroutine-call in sapscript editor like:
/: perform <form_name> in program <program_name>
/: using <var1>
/: using <var2>
/: changing <return1>
/: changing <return2>
/:endperform
Maybe you are looking for
-
Hi! Try to explain my problem. I have a Servlet (call com.foo.core.ProxyServlet) which uses HttpUrLConnection (it's a proxy). The problem is : after a week all thread are frozen in the same method. Here the thread dump : "ExecuteThread: '26' for queu
-
Why does Mail keep crashing when I try to open it
Hello Recently I received an email (from a .gov address, no less) and when I tried to do anything to it - move it, delete it, etc, Mail would crash. Finally I got Mail to stop closing, but it's sitting on my Inbox. Today I had cancel my camping reser
-
How to use iMessage for all the iOS devices registered on one apple ID
I have 5 iOS device for my family on my appleID. But I want have different ID to use iMessage for all devices. Is it possible? How?
-
HP LaserJet CP 1525nw and iPad 3 Issue
My iPad is not recognizing the printer. I updated the printer's firmware and the iPad recognized and printed to it once, and not again since. My iPhone prints every time. Any suggestions would be appreciated.
-
Open PDF in browser from Flash
I want people to be able to click a link in my Flash site and for Acrobat to open the PDF, or have it open in their browser, instead of downloading the PDF to their desktop. Thanks!