NAST Protocol Update
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = ?
msg_nr = ?
msg_ty = ?
MSG_V1 = 'Sales Order has been sent for credit check'
* MSG_V2 = ' '
* MSG_V3 = ' '
* MSG_V4 = ' '
* EXCEPTIONS
* MESSAGE_TYPE_NOT_VALID = 1
* NO_SY_MESSAGE = 2
* OTHERS = 3
I need to use this function module to populate the message after clicking processing log for output determination of sales order. I simply need to say that Sales Order No X has been sent for credit check.
What should the values be
Hi,
You can create a message in SE91...And give the message number & message class..
Or you can give an existing message class which has just &.
Try this..
Ex..
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = '00'
msg_nr = '208'
msg_ty = 'S'
MSG_V1 = 'Sales Order has been sent for credit check'
MSG_V2 = ' '
MSG_V3 = ' '
MSG_V4 = ' '
EXCEPTIONS
MESSAGE_TYPE_NOT_VALID = 1
NO_SY_MESSAGE = 2
OTHERS = 3
Thanks,
Naren
Similar Messages
-
Hi Folks,
It is quite explanatory why I am posting this question.
I am trying to update a nast protocol in my driver program and I am popualting the nast table using nast_protocol_update in sales Invoicing. The problem is that expect issuing printing the output type is not updating with an error icon and there is no log in processing log.
Please help me where the problem could have been.
The updation is not reflecting in the nast table.
Thanks and Regards,
Krishna MukthineniThanks Bharani,
first the processing log is not getting populated for VF03 even when the driver program is populated with the error state and upating through nast_protocol_update.
Please suggest any solution.
Regards,
Krishna Mukthineni -
How to send the PDF file to FAX will the nast table updates
Hi all,
How to send the PDF file to FAX. Will the nast table updates ( which fields updates ).
Need is once fax is send for that delivery, again it should not fax again. Will the nast table helps to check the sent fax.
Please give me sutable suggessions....Have you checked Forums » Community Discussions » Code Snippets
I believe there were some examples on converting/sending PDF.
Or check FM 'SO_DOCUMENT_SEND_API1' and documentation for it. -
HI
We have around 200o invoice in which one specific output type called ZIDR is in process yellow state. We wanted to update it to green.
Is there any utility program which updates NAST-VSTAT based on message type?
Reg
shan1242Hi Shan .,
Program Short description
ASTBKF08 Convert processing status single NAST
NASTVF08 Convert processing status single NAST
if You need Function modules
RV_MESSAGE_SET_PROCESS_STATE
thanks
Sreenivas Reddy
Edited by: Sreenivas Reddy Dommata on Aug 21, 2008 10:56 AM -
Processing log not getting updated for send immediatly
Hi,
I have a custom output type and a Custom function module for issueing the output for delivery, my prob is that it processing log is getting updated for the send in batch and other options but it is not getting updated for the SEND IMMEDIATLY, I am using the same FM for the Output issue I am checking if they have selected output type as 4 if yes, I am calling a FM in perform by saying
PERFORM xxxxxxxx ON COMMIT
and in the perform I am calling a FM
CALL FUNCTION xxxxxxxxx in BACKGROUND TASK AS A SEPARATE TASK,
the functioanlity of issueing the output is working but the Processing log is not getting updated.
What might be the problem ? it is getting updated for Send in batch but not for except 4.I am updating Log using this form
at every step I am collecting the messages and passing them to this form.
FORM update_nast_log USING p_msgid
p_msgnr
p_msgty
p_msgv1
p_msgv2
p_msgv3
p_msgv4.
* Local data declaration
DATA: lv_msgid LIKE sy-msgid,
lv_msgnr LIKE sy-msgno,
lv_msgty LIKE sy-msgty,
lv_msgv1 LIKE sy-msgv1,
lv_msgv2 LIKE sy-msgv2,
lv_msgv3 LIKE sy-msgv3,
lv_msgv4 LIKE sy-msgv4.
* clear all the local variables
CLEAR:lv_msgid,
lv_msgnr,
lv_msgty,
lv_msgv1,
lv_msgv2,
lv_msgv3,
lv_msgv4.
* move message ID,number,msg type and the messsages
* to local variables
MOVE: p_msgid TO lv_msgid,
p_msgnr TO lv_msgnr,
p_msgty TO lv_msgty,
p_msgv1 TO lv_msgv1,
p_msgv2 TO lv_msgv2,
p_msgv3 TO lv_msgv3,
p_msgv4 TO lv_msgv4.
* Update nast table using nast protocol update
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = lv_msgid
msg_nr = lv_msgnr
msg_ty = lv_msgty
msg_v1 = lv_msgv1
msg_v2 = lv_msgv2
msg_v3 = lv_msgv3
msg_v4 = lv_msgv4.
ENDFORM. " UPDATE_NAST_LOG -
Hi all, i'm using this coding to update nast table for Purchase Order .This coding is not working.
please help me to solve this problem.
Your help is greatly appreciated.
tables nast.
nast-MANDT = sy-mandt.
nast-KAPPL = 'EF'.
nast-OBJKY = '4100000477'.
nast-KSCHL = 'NEU'.
nast-SPRAS = sy-langu.
nast-PARNR = '0000100165'.
nast-PARVW = 'LF'.
nast-ERDAT = sy-datum.
nast-ERUHR = sy-uzeit.
nast-NACHA = '1'.
nast-ANZAL = '0'.
nast-VSZTP = '1'.
nast-MANUE = 'X'.
nast-USNAM = sy-UNAME.
nast-VSTAT = '0'.
nast-LDEST = 'HOIT'.
nast-TDID = 'BEWG'.
nast-TDSPRAS = sy-langu.
nast-NAUTO = 'X'.
nast-TDRECEIVER = sy-UNAME.
nast-TDCOVTITLE = 'New Purchase Order Printout'.
CALL FUNCTION 'NAST_SAVE_OBJECT'
EXPORTING
pi_nast = nast
PI_LINK_OBJECT = 'X'
PI_PROCESSING = 'X'
EXCEPTIONS
NOT_SAVED = 1
OTHERS = 2
IF sy-subrc <> 0.
write: / 'NOT SAVED'.
ELSE.
write: / 'SAVED'.
ENDIF.
IF sy-subrc = 0.
COMMIT WORK.
write / 'TABLE "NAST" WAS UPDATED'.
else.
rollback work.
write / 'TABLE "NAST" WAS NOT UPDATED'.
endif.Hi,
The following piece of coding should be changed as
IF sy-subrc <> 0.
write: / 'NOT SAVED'.
ELSE.
write: / 'SAVED'.
ENDIF.
IF sy-subrc = 0.
COMMIT WORK.
write / 'TABLE "NAST" WAS UPDATED'.
else.
rollback work.
write / 'TABLE "NAST" WAS NOT UPDATED'.
endif.
<u>Changed code:</u>
IF sy-subrc <> 0.
rollback work.
write / 'TABLE "NAST" WAS NOT UPDATED'.
ELSE.
COMMIT WORK.
write / 'TABLE "NAST" WAS UPDATED'.
ENDIF. -
AMule 2.2.1 - updated PKGBUILD
Hello,
As i couldnt see any new package in both extra and testing repos (the one is in extra is a bit older.), i've made my own aMule 2.2.1 package. It doesnt need wx patch anymore, here's simple PKGBUILD (based on contributors package)
What's new with 2.2 series?
* Protocol Obfuscation
* UPnP support
* Network protocol updated to eMule 0.49a (including large file support)
* Kad 2.0
* Improved skin support and country flags
* Support for compilation with MS Visual Studio -> WOW!
# $Id: PKGBUILD 356 2008-04-18 22:56:27Z aaron $
# Maintainer: damir <[email protected]>
# Contributor: Henrik Ronellenfitsch <[email protected]>
pkgname=amule
pkgver=2.2.1
pkgrel=5
pkgdesc="aMule is a eMule-like client for ed2k p2p network"
arch=("i686" "x86_64")
license=('GPL')
url="http://www.amule.org"
depends=('wxgtk>=2.8.0.1' 'gd>=2.0.34' 'binutils>=2.17.50.0.18')
makedepends=('crypto++')
source=(http://downloads.sourceforge.net/amule/aMule-${pkgver}.tar.bz2)
md5sums=('bfa8237e9682fd9d6fce72e152276f49')
sha1sums=('c4a98fd034ae9af9ace632c9bc9f51a75405c271')
build() {
cd ${startdir}/src/aMule-${pkgver}
./configure --prefix=/usr \
--disable-embedded_crypto \
--enable-utf8-systray \
--enable-cas \
--enable-wxcas \
--enable-amule-daemon \
--enable-amulecmd \
--enable-amule-gui \
--enable-alc \
--enable-alcc \
--enable-webserver
make || return 1
make DESTDIR=${startdir}/pkg installWell, I was doing my own PKGBUILD for aMule too and found a problem present in your package too...
Initialising aMule
Checking if there is an instance already running...
No other instances are running.
HTTP download thread started
ListenSocket: Ok.
A fatal error has occurred and aMule has crashed.
Please assist us in fixing this problem by posting the backtrace below in our
'aMule Crashes' forum and include as much information as possible regarding the
circumstances of this crash. The forum is located here:
http://forum.amule.org/index.php?board=67.0
If possible, please try to generate a real backtrace of this crash:
http://www.amule.org/wiki/index.php/Backtraces
----------------------------=| BACKTRACE FOLLOWS: |=----------------------------
Current version is: aMule 2.2.1 using wxGTK2 v2.8.7
Running on: Linux 2.6.25-ARCH i686
[2] ?? in amule [0x8076f13]
[3] wxFatalSignalHandler in /usr/lib/libwx_baseu-2.8.so.0[0xb7bcc646]
[4] ?? in [0xb80ce400]
[5] ?? in amule [0x828ceeb]
[6] ?? in amule [0x8215ebd]
[7] ?? in amule [0x8215e43]
[8] ?? in amule [0x82162ab]
[9] ?? in amule [0x8216349]
[10] ?? in amule [0x81efff5]
[11] ?? in amule [0x81e7d78]
[12] ?? in amule [0x81e8075]
[13] ?? in amule [0x807bb2d]
[14] ?? in amule [0x81e7847]
[15] wxEntry(int&, wchar_t**) in /usr/lib/libwx_baseu-2.8.so.0[0xb7b5ce90]
[16] wxEntry(int&, char**) in /usr/lib/libwx_baseu-2.8.so.0[0xb7b5cf67]
[17] ?? in amule [0x81e8227]
[18] __libc_start_main in /lib/libc.so.6[0xb78865c5]
[19] wxAppBase::MainLoop() in amule[0x8072bf1]
Arch Linux up-to-date, of course... Does aMule work well for you? -
Updating processing log for sales order header output
I want to prevent a custom sales order confirmation from printing when the order has not been approved. When the user requests the form to print in the background, I want to update the processing log to have a red light and a message indicating the order has not been approved, so it cannot be printed. When I pass an error message to the protocol processing, the update is terminated and my changes to the sales order are lost. Is there a way to update the processing log, show the red light, and not get the hard error?
Thank you in advance.
JaySetting the return code after the protocol update did the trick.
-
Dear All.
Till this day the duty-form for a company were performed through a
special Form Program, it is performed via processing routines.
The first Form Routine's name is entry.
Form was printed-out for each Transport up to now.
Current Requirements are for next time as follows:
Printing out one form for every delivery (shipment) instead of
for each Transport as so far. Please notice one Transport may
consist of many deliveries (Shipment). 1 Transport : n Shipment.
DATA:
lc_wa_usrdata TYPE /Z2a/ty_lw_usrdata.
INCLUDE rvadtabl.
SET EXTENDED CHECK OFF.
TABLES: vbpla, thead, ttxer, ttxit, t005, vbddl, stxh, sadr."SADR40A
INCLUDE vttkdata. "Shipment Header
INCLUDE vttsdata. "Shipment Segment
INCLUDE vttpdata. "Shipment Items
INCLUDE vbpadata. "Partner
INCLUDE vtfadata. "Flow
INCLUDE sadrdata. "Address
INCLUDE vtlfdata. "Delivery Selection
INCLUDE vsedata. "shipping units
INCLUDE rv56acom. "I/O-Structure
SET EXTENDED CHECK ON.
TABLES: /Z2a/tv_schein.
FORM entry USING return_code us_screen.
DATA: lf_retcode TYPE sy-subrc.
screen = us_screen.
PERFORM processing USING us_screen
CHANGING lf_retcode.
IF lf_retcode NE 0.
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDFORM.
FORM processing USING proc_screen
CHANGING cf_retcode.
DATA: ls_print_data_to_read TYPE ledlv_print_data_to_read.
DATA: ls_dlv_delnote TYPE ledlv_delnote.
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_addr_key LIKE addr_key.
DATA: ls_header LIKE /Z2a/ss_pv_kopf.
DATA: tb_daten LIKE /Z2a/ss_pv_daten OCCURS 1.
DATA: lc_va_lfnr TYPE nrlevel.
DATA: lc_va_year TYPE char4.
DATA: lc_va_keyseg_pv TYPE /dca/p000_keyseg.
DATA: lc_tb_bwdat_pv TYPE /dca/p000_ty_tb_bwdat.
DATA: lc_wa_bwdat_pv TYPE /dca/p000_ty_wa_bwdat.
DATA: lc_wa_bwm_res_pv TYPE /Z2a/dat_cu_pvschein.
DATA: lc_va_lifnr TYPE kunnr.
DATA: lc_va_nr TYPE nrnr.
DATA: lc_va_anz TYPE /Z2a/anz_pv.
DATA: lc_va_no TYPE /Z2a/anz_kein_pv.
DATA: lc_wa_pvschein LIKE /Z2a/tv_schein.
DATA: lc_va_line LIKE sy-tabix.
DATA: lc_va_flag_zoll TYPE segal,
lc_va_rqident TYPE rspoid,
lc_va_vsart TYPE vsarttr,
lc_va_tknum TYPE tknum.
DATA: lc_va_obj TYPE nrobj.
DATA: lc_va_printer TYPE rspopname.
DATA: lc_va_pv_kz TYPE char4.
DATA: lc_va_tplst TYPE tplst.
* SmartForm from customizing table TNAPR
lf_formname = tnapr-sform.
* determine print data
PERFORM set_print_data_to_read USING lf_formname
CHANGING ls_print_data_to_read
cf_retcode.
IF cf_retcode = 0.
* select print data
PERFORM get_data_pv TABLES tb_daten
CHANGING ls_header
lc_va_flag_zoll
lc_va_vsart
lc_va_tplst
cf_retcode.
ENDIF.
lc_va_tknum = nast-objky.
IF cf_retcode = 0.
ELSE.
PERFORM protocol_nast_update.
cf_retcode = 4.
EXIT.
ENDIF.
IF cf_retcode = 0.
* determine smartform function module for delivery note
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING formname = lf_formname
IMPORTING fm_name = lf_fm_name
EXCEPTIONS no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
DESCRIBE TABLE tb_daten LINES lc_va_line.
IF lc_va_line <> 0.
lc_va_pv_kz = 'JA'.
SELECT SINGLE lifnr
FROM vtpa
INTO lc_va_lifnr
WHERE vbeln = nast-objky
AND parvw = 'YL'.
lc_va_keyseg_pv = ls_header-kunnr.
lc_va_keyseg_pv+10(10) = lc_va_lifnr.
lc_va_keyseg_pv+20(2) = lc_va_vsart.
lc_va_keyseg_pv+22(4) = lc_va_pv_kz.
CALL FUNCTION '/ZTR/P000_MCDATA_FROM_'
EXPORTING
cv_va_keytyp = '/Z2a/KEY_CU_PVSCHEIN'
cv_va_keyseg = lc_va_keyseg_pv
TABLES
cr_tb_bwdat = lc_tb_bwdat_pv.
IF lc_tb_bwdat_pv[] IS INITIAL.
cf_retcode = 4.
ELSE.
LOOP AT lc_tb_bwdat_pv INTO lc_wa_bwdat_pv.
lc_wa_bwm_res_pv = lc_wa_bwdat_pv-datseg.
lc_va_obj = lc_wa_bwm_res_pv(10).
lc_va_nr = lc_wa_bwm_res_pv+10(2).
lc_va_anz = lc_wa_bwm_res_pv+12(8).
lc_va_printer = lc_wa_bwm_res_pv+20(4).
SELECT SINGLE pvno
FROM /Z2a/tv_schein
INTO lc_va_lfnr
WHERE tknum = nast-objky.
IF sy-subrc = 0.
ELSE.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_va_nr
object = lc_va_obj
IMPORTING
number = lc_va_lfnr
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
* call smartform delivery note
ls_composer_param-tddest = lc_va_printer.
* ls_control_param-device = lc_va_printer.
lc_va_year = sy-datum(4).
PERFORM set_print_param USING ls_addr_key
lc_va_lfnr
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
cf_retcode.
lc_wa_usrdata-mandt = sy-mandt.
lc_wa_usrdata-udate = sy-datum.
lc_wa_usrdata-uzeit = sy-uzeit.
lc_wa_usrdata-usr = sy-uname.
lc_wa_usrdata-sysid = sy-sysid.
DO lc_va_anz TIMES.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
ls_header = ls_header
lc_va_lfnr = lc_va_lfnr
lc_va_year = lc_va_year
lc_va_tplst = lc_va_tplst
lc_wa_usrdata = lc_wa_usrdata
TABLES
tb_daten = tb_daten
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
ENDDO.
ELSE.
lc_va_pv_kz = 'NEIN'.
SELECT SINGLE lifnr
FROM vtpa
INTO lc_va_lifnr
WHERE vbeln = nast-objky
AND parvw = 'YL'.
lc_va_keyseg_pv = ls_header-kunnr.
lc_va_keyseg_pv+10(10) = lc_va_lifnr.
lc_va_keyseg_pv+20(2) = lc_va_vsart.
lc_va_keyseg_pv+22(4) = lc_va_pv_kz.
CALL FUNCTION '/ZTR/P000_MCDATA_FROM_'
EXPORTING
cv_va_keytyp = '/Z2a/KEY_CU_PVSCHEIN'
cv_va_keyseg = lc_va_keyseg_pv
TABLES
cr_tb_bwdat = lc_tb_bwdat_pv.
IF lc_tb_bwdat_pv[] IS INITIAL.
cf_retcode = 4.
ELSE.
LOOP AT lc_tb_bwdat_pv INTO lc_wa_bwdat_pv.
lc_wa_bwm_res_pv = lc_wa_bwdat_pv-datseg.
lc_va_obj = lc_wa_bwm_res_pv(10).
lc_va_nr = lc_wa_bwm_res_pv+10(2).
lc_va_anz = lc_wa_bwm_res_pv+12(8).
lc_va_printer = lc_wa_bwm_res_pv+20(4).
SELECT SINGLE pvno
FROM /Z2a/tv_schein
INTO lc_va_lfnr
WHERE tknum = nast-objky.
IF sy-subrc = 0.
UPDATE /Z2a/tv_schein
SET flag_pv = ' '
WHERE tknum = nast-objky.
ELSE.
* laufende nummer füllen, bei keinen PV-Teilen Nummernkreis 99
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = lc_va_nr
object = lc_va_obj
* QUANTITY = '1'
* SUBOBJECT = ' '
* TOYEAR = '0000'
* IGNORE_BUFFER = ' '
IMPORTING
number = lc_va_lfnr
* QUANTITY =
* RETURNCODE =
* EXCEPTIONS
* INTERVAL_NOT_FOUND = 1
* NUMBER_RANGE_NOT_INTERN = 2
* OBJECT_NOT_FOUND = 3
* QUANTITY_IS_0 = 4
* QUANTITY_IS_NOT_1 = 5
* INTERVAL_OVERFLOW = 6
* BUFFER_OVERFLOW = 7
* OTHERS = 8
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDLOOP.
lc_va_year = sy-datum(4).
ls_composer_param-tddest = lc_va_printer.
PERFORM set_print_param USING ls_addr_key
lc_va_lfnr
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
cf_retcode.
lc_wa_usrdata-mandt = sy-mandt.
lc_wa_usrdata-udate = sy-datum.
lc_wa_usrdata-uzeit = sy-uzeit.
lc_wa_usrdata-usr = sy-uname.
lc_wa_usrdata-sysid = sy-sysid.
DO lc_va_anz TIMES.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = ' '
ls_header = ls_header
lc_va_lfnr = lc_va_lfnr
lc_va_year = lc_va_year
lc_va_tplst = lc_va_tplst
lc_wa_usrdata = lc_wa_usrdata
TABLES
tb_daten = tb_daten
EXCEPTIONS formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
ENDDO.
ENDIF.
ENDIF.
SELECT SINGLE *
FROM /Z2a/tv_schein
INTO lc_wa_pvschein
WHERE tknum = nast-objky.
IF sy-subrc = 0.
ELSE.
IF NOT lc_va_lfnr IS INITIAL.
lc_wa_pvschein-mandt = sy-mandt.
lc_wa_pvschein-tknum = nast-objky.
INSERT INTO /Z2a/tv_schein
VALUES lc_wa_pvschein.
UPDATE /Z2a/tv_schein SET
pvno = lc_va_lfnr
vsart = lc_va_vsart
exti1 = ls_header-schiffname
signi = ls_header-siegel
flag_zoll = lc_va_flag_zoll
exti2 = ls_header-contnr
lifex = ls_header-mbcnr
dalen = ls_header-dalen
dptbg = ls_header-dptbg
kunnr = ls_header-kunnr
add03 = ls_header-add03
parnr = lc_va_lifnr
datum_druck = sy-datum
uzeit_druck = sy-uzeit
ernam_druck = sy-ucomm
WHERE tknum = nast-objky.
IF tb_daten IS INITIAL.
UPDATE /Z2a/tv_schein SET
flag_pv = ' '
WHERE tknum = nast-objky.
ELSE.
UPDATE /Z2a/tv_schein SET
flag_pv = 'X'.
ENDIF.
ENDIF.
ENDIF.
* get SmartForm protocoll and store it in the NAST protocoll
* PERFORM ADD_SMFRM_PROT. DEL_HP_335958
ENDFORM.
FORM get_data_pv TABLES lc_tb_daten
CHANGING cs_header TYPE /Z2a/ss_pv_kopf
lc_va_flag_zoll TYPE segal
lc_va_vsart TYPE vsarttr
lc_va_tplst TYPE tplst
cf_retcode.
TYPES: BEGIN OF ty_wa_vbeln,
vbeln TYPE vbeln_vl,
END OF ty_wa_vbeln,
ty_tb_vbeln TYPE STANDARD TABLE OF ty_wa_vbeln
WITH DEFAULT KEY
INITIAL SIZE 0,
ty_wa_lips LIKE lips,
ty_tb_lips TYPE STANDARD TABLE OF ty_wa_lips
WITH DEFAULT KEY
INITIAL SIZE 0.
DATA: lc_tb_cond LIKE /Z2a/ss_pv_daten OCCURS 1.
DATA: lc_wa_daten TYPE /Z2a/ss_pv_daten.
DATA: lc_wa_cond TYPE /Z2a/ss_pv_daten.
DATA: lc_va_tknum TYPE tknum,
lc_tb_lips TYPE ty_tb_lips,
lc_wa_lips TYPE ty_wa_lips,
lc_va_kunnr TYPE kunnr,
lc_va_pvvkz TYPE /Z2a/pvvkz,
lc_va_exprf TYPE exprf,
lc_va_matnr TYPE matnr,
lc_va_menge TYPE lfimg.
DATA: lc_tb_vbeln TYPE ty_tb_vbeln,
lc_wa_vbeln TYPE ty_wa_vbeln,
lc_va_land1 TYPE land1,
lc_va_lifnr TYPE lifnr.
DATA: lc_va_exnum TYPE exnum.
DATA: lc_va_keyseg TYPE /dca/p000_keyseg.
DATA: lc_tb_bwdat TYPE /dca/p000_ty_tb_bwdat.
DATA: lc_wa_bwdat TYPE /dca/p000_ty_wa_bwdat.
DATA: lc_wa_bwm_result TYPE /Z2a/dat_cu_pvabwicklung.
DATA language LIKE nast-spras.
DATA shipment_number LIKE vttk-tknum.
CLEAR cf_retcode.
* get data
language = nast-spras.
shipment_number = nast-objky.
CALL FUNCTION 'RV_SHIPMENT_PRINT_VIEW'
EXPORTING
shipment_number = shipment_number
option_tvtk = 'X' "Shipmenttype J/N
option_ttds = 'X' "Disposition J/N
language = language
option_items = 'X' "Transport Items J/N
option_segments = 'X' "Transport Segments J/N
option_partners = 'X' "Partners J/N
option_sales_orders = 'X' "Sales orders J/N
option_export_data = 'X' "Export data J/N
option_packages = 'X' "Packages J/N
option_flow = ' ' "Flow J/N
option_no_refresh = ' ' "Refresh Tables J/N
IMPORTING
f_vttkvb = vttkvb "Shipment Header
f_tvtk = tvtk "Shipmenttype
f_tvtkt = tvtkt "Description Shipmenttype
f_ttds = ttds "Disposition
f_ttdst = ttdst "Description Disposition
f_vbpla = vbpla "Packages
TABLES
f_vttp = xvttp "Shipment Items
f_trlk = slk "Delivery
f_trlp = slp "Delivery Item
f_vtts = xvtts "Shipment Segments
f_vtsp = xvtsp "Segments/Items
f_vbpa = xvbpa "Partner
f_vbadr = xvbadr "Address
f_vtfa = xvtfa "Flow
f_vbplk = xvbplk "Shipment Unit Header
f_vbplp = xvbplp "Shipment Unit
f_vbpls = xvbpls "Shipment Unit Sum
EXCEPTIONS
not_found = 1.
cs_header-tknum = nast-objky.
cs_header-schiffname = vttkvb-exti1.
cs_header-abfahrt = vttkvb-dptbg.
cs_header-contnr = vttkvb-exti2.
cs_header-normt = vttkvb-add01.
cs_header-siegel = vttkvb-signi.
cs_header-gewbr = vttkvb-text2.
cs_header-gewnt = vttkvb-text3.
cs_header-dalen = vttkvb-dalen.
cs_header-dptbg = vttkvb-dptbg.
cs_header-add03 = vttkvb-add03.
lc_va_tplst = vttkvb-tplst.
lc_va_vsart = vttkvb-vsart.
SELECT vbeln
FROM vttp
INTO TABLE lc_tb_vbeln
WHERE tknum = lc_va_tknum.
LOOP AT lc_tb_vbeln INTO lc_wa_vbeln.
SELECT SINGLE kunnr lifex
FROM likp
INTO (lc_va_kunnr, cs_header-mbcnr)
WHERE vbeln = lc_wa_vbeln-vbeln.
SELECT *
FROM lips
INTO TABLE lc_tb_lips
WHERE vbeln = lc_wa_vbeln-vbeln.
ENDLOOP.
LOOP AT lc_tb_lips INTO lc_wa_lips.
SELECT SINGLE pvvkz
FROM /Z2a/ldm_kun
INTO lc_va_pvvkz
WHERE kunnr = lc_va_kunnr.
IF lc_va_pvvkz NE 'X'.
cf_retcode = 4.
EXIT.
ELSE.
SELECT SINGLE exnum segal
FROM eikp
INTO (lc_va_exnum, lc_va_flag_zoll)
WHERE refnr = lc_wa_lips-vbeln.
SELECT SINGLE exprf
FROM eipo
INTO lc_va_exprf
WHERE exnum = lc_va_exnum
AND expos = lc_wa_lips-posnr.
lc_va_keyseg = lc_va_exprf.
CALL FUNCTION '/ZTR/P000_MCDATA_FROM_'
EXPORTING
cv_va_keytyp = '/Z2a/KEY_CU_PVABWICKLUNG'
cv_va_keyseg = lc_va_keyseg
TABLES
cr_tb_bwdat = lc_tb_bwdat.
IF NOT lc_tb_bwdat[] IS INITIAL.
LOOP AT lc_tb_bwdat INTO lc_wa_bwdat.
lc_wa_bwm_result = lc_wa_bwdat-datseg.
IF lc_wa_bwm_result-pv_relevant = 'X'.
* Kumulieren
lc_wa_cond-matnr = lc_wa_lips-matnr.
SELECT SINGLE maktx
FROM makt
INTO lc_wa_cond-arktx
WHERE matnr = lc_wa_lips-matnr
AND spras = 'DE'.
lc_wa_cond-menge = lc_wa_lips-lfimg.
lc_wa_cond-me = lc_wa_lips-meins.
COLLECT lc_wa_cond INTO lc_tb_cond.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
cs_header-kunnr = lc_va_kunnr.
SELECT SINGLE name1 name2 land1
INTO (cs_header-name1,
cs_header-name2,
lc_va_land1)
FROM kna1
WHERE kunnr = lc_va_kunnr.
SELECT SINGLE landx
INTO cs_header-land
FROM t005t
WHERE spras = sy-langu
AND land1 = lc_va_land1.
* Sortieren Aufsteigend nach Materialnr
SORT lc_tb_cond ASCENDING BY matnr.
* Übergabe an Ausgabetabelle
LOOP AT lc_tb_cond INTO lc_wa_cond.
MOVE-CORRESPONDING lc_wa_cond TO lc_wa_daten.
APPEND lc_wa_daten TO lc_tb_daten.
ENDLOOP.
ENDFORM. " get_data_spat
FORM set_print_data_to_read
USING if_formname LIKE tnapr-sform
CHANGING cs_print_data_to_read TYPE ledlv_print_data_to_read
cf_retcode.
FIELD-SYMBOLS: <fs_print_data_to_read> TYPE xfeld.
DATA: lt_fieldlist TYPE tsffields.
DATA: ls_fieldlist TYPE LINE OF tsffields.
DATA: lf_field1 TYPE LINE OF tsffields.
DATA: lf_field2 TYPE LINE OF tsffields.
DATA: lf_field3 TYPE LINE OF tsffields.
CALL FUNCTION 'SSF_FIELD_LIST'
EXPORTING
formname = if_formname
* VARIANT = ' '
IMPORTING
fieldlist = lt_fieldlist
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
cf_retcode = sy-subrc.
CLEAR lt_fieldlist.
ELSE.
* set print data requirements
LOOP AT lt_fieldlist INTO ls_fieldlist.
SPLIT ls_fieldlist AT '-' INTO lf_field1 lf_field2 lf_field3.
* <<<< START_OF_INSERTION_HP_350342 >>>>
IF lf_field1 = 'IS_DLV_DELNOTE' AND lf_field2 = 'IT_SERNR'.
lf_field2 = 'IT_SERNO'.
ENDIF.
* <<<< END_OF_INSERTION_HP_350342 >>>>
ASSIGN COMPONENT lf_field2 OF STRUCTURE
cs_print_data_to_read TO <fs_print_data_to_read>.
IF sy-subrc = 0.
<fs_print_data_to_read> = 'X'.
ENDIF.
ENDLOOP.
* header data is always required
cs_print_data_to_read-hd_gen = 'X'.
* adress is always required for print param
cs_print_data_to_read-hd_adr = 'X'.
* organisational data is always required for include texts
cs_print_data_to_read-hd_org = 'X'.
ENDIF.
ENDFORM. " set_print_data_to_read
*& Form set_print_param
* text
* -->P_LS_ADDR_KEY text
* <--P_LS_CONTROL_PARAM text
* <--P_LS_COMPOSER_PARAM text
* <--P_LS_RECIPIENT text
* <--P_LS_SENDER text
* <--P_CF_RETCODE text
FORM set_print_param USING is_addr_key LIKE addr_key
* lc_va_tknum
lc_va_lfnr TYPE nrlevel
CHANGING cs_control_param TYPE ssfctrlop
cs_composer_param TYPE ssfcompop
cs_recipient TYPE swotobjid
cs_sender TYPE swotobjid
cf_retcode TYPE sy-subrc.
DATA: ls_itcpo TYPE itcpo.
DATA: lf_repid TYPE sy-repid.
DATA: lf_device TYPE tddevice.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lc_va_suffix TYPE rspo2name.
lf_repid = sy-repid.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_addr_key = is_addr_key
pi_repid = lf_repid
IMPORTING
pe_returncode = cf_retcode
pe_itcpo = ls_itcpo
pe_device = lf_device
pe_recipient = cs_recipient
pe_sender = cs_sender.
SHIFT lc_va_lfnr LEFT DELETING LEADING '0'.
CONCATENATE 'PV' lc_va_lfnr INTO lc_va_suffix.
IF cf_retcode = 0.
MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
cs_composer_param-tdsuffix2 = lc_va_suffix.
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-preview = screen.
cs_control_param-getotf = ls_itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
ENDIF.
ENDFORM. " set_print_param
FORM protocol_nast_update.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = '/Z2a/PVSCHEIN'
msg_nr = '001'
msg_ty = 'E'
* MSG_V2 = SYST-MSGV2
* MSG_V3 = SYST-MSGV3
* MSG_V4 = SYST-MSGV4
* MSG_V1 = SYST-MSGV1
EXCEPTIONS
OTHERS = 1.
ENDFORM.Hello!
I have to customize the enclosed source code so it does the following:
print out for each shipment (see FuBa:RV_SHIPMENT_PRINT_VIEW
parameter slp) really seperated by for every shipment item LIKP-VBELN
and not for the whole VTTP-TKNUM.
The parameter "slp" must be stripted so by leaving
of the routine "get_data_pv" has only the datas of the current
LIKP-VBELN, and in the next step taking the next LIKP-VBELN
and so on. Right now it performs only one time for one VTTP-TKNUM.
If you don't understand VTTP-TKNUM and LIKP-VBELN please refer
to Transaction SE11.
Reagrds
Ilhan -
Hi,
Could anybody post the program and form in XML format for pick list smartform /SMB40/SDPLK_L ?
I could not find this smartform in the preconfigured package in market place.
Thanks Appreciated.
AnnaHere is the print program:
* Print of pickinglist for one single delivery note with Smart Form
REPORT /bpr3pf/rvadek01 LINE-COUNT 100 MESSAGE-ID vn.
TABLES: vbco3, "Communicationarea for view
vblkk, "Headerview
vblkp, "Itemview
ltak, "Transportauftrag
adrs, "Communicationarea for Address
riserls, "Serialnumbers
komser, "Communicationarea Serialnumbers
tvst, tvstt, "Shipping point
vbkok, vbpok.
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
TYPE-POOLS szadr.
DATA: retcode LIKE sy-subrc, "Returncode
xvbeln LIKE likp-vbeln,
xkomau LIKE likp-vbeln,
xscreen(1) TYPE c. "Output on printer or screen
DATA: BEGIN OF tvblkp OCCURS 0. "Internal table for items
INCLUDE STRUCTURE vblkp.
DATA: END OF tvblkp.
DATA: BEGIN OF tsernr OCCURS 0. "Internal table for serialnumbers
INCLUDE STRUCTURE riserls.
DATA: END OF tsernr.
DATA: BEGIN OF tsernr_print OCCURS 0.
INCLUDE STRUCTURE komser.
DATA: END OF tsernr_print.
DATA: BEGIN OF tltap OCCURS 50. "TA-Positionen
INCLUDE STRUCTURE ltap.
INCLUDE STRUCTURE ltap1.
DATA: END OF tltap.
DATA: BEGIN OF svblkp.
INCLUDE STRUCTURE vblkp.
DATA: END OF svblkp.
INCLUDE /smb40/vblpdata.
*include vblpdata.
INCLUDE /smb40/vbfadata.
*include vbfadata.
INCLUDE /smb40/vbukdata.
*include vbukdata.
INCLUDE /smb40/vbupdata.
*include vbupdata.
INCLUDE /smb40/vbbddata.
*include vbbddata.
INCLUDE /smb40/vbpadata.
*include vbpadata.
INCLUDE /smb40/sadrdata.
*include sadrdata.
* FORM ENTRY *
* Steuerung des Drucks *
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.
* Kommimengen an Lieferungen zurückgeben, aber nicht bei Druckansicht
IF xscreen = ' '.
PERFORM delivery_update.
ENDIF.
return_code = 0.
ENDIF.
ENDFORM. "entry
* FORM PROCESSING *
* --> PROC_SCREEN *
FORM processing USING proc_screen.
REFRESH: xlips,
xvbfa,
xvbuk,
xvbup,
yvbfa,
yvbuk,
yvbup.
PERFORM get_data.
CHECK retcode = 0.
PERFORM get_comm USING proc_screen tvst-aland.
CHECK retcode = 0.
PERFORM user_exit1.
PERFORM smartform_print.
CHECK retcode = 0.
ENDFORM. "processing
* S U B R O U T I N E S *
* FORM DELIVERY_UPDATE *
* Ergänzen Lieferung um Kommissionierinformation *
* Ergänzen der Lieferungen um Kommissionierinformation
FORM delivery_update.
DATA: BEGIN OF hvbpok OCCURS 10. "Lieferpositionen Kommiss.
INCLUDE STRUCTURE vbpok.
DATA: END OF hvbpok.
DATA: BEGIN OF sav_nast.
INCLUDE STRUCTURE nast.
DATA: END OF sav_nast.
* DATA: SYNC_FLAG TYPE C. "synchrone Verbuchung?
* Füllen Lieferkopfdaten für Kommi-Update
vbkok-vbeln_vl = xvbeln.
vbkok-vbeln = vblkk-komau.
* Füllen Positionsdaten zu Liefernr.
LOOP AT tvblkp.
hvbpok-vbeln_vl = tvblkp-vbeln.
hvbpok-posnr_vl = tvblkp-posnr.
hvbpok-posnn = tvblkp-posnr.
hvbpok-vbeln = vblkk-komau.
hvbpok-vbtyp_n = 'Q'.
hvbpok-pikmg = tvblkp-komng.
hvbpok-meins = tvblkp-meins.
hvbpok-ndifm = 0.
hvbpok-taqui = ' '.
hvbpok-charg = tvblkp-charg.
hvbpok-matnr = tvblkp-matnr.
hvbpok-brgew = tvblkp-brgew.
hvbpok-gewei = tvblkp-gewei.
hvbpok-volum = tvblkp-volum.
hvbpok-voleh = tvblkp-voleh.
hvbpok-orpos = 0.
APPEND hvbpok.
ENDLOOP.
* IF NAST-VSZTP <> 4.
* SYNC_FLAG = 'X'.
* ELSE.
* SYNC_FLAG = ' '.
* ENDIF.
sav_nast = nast.
CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING'
EXPORTING
nicht_sperren = 'X'
vbkok_wa = vbkok
aufrufer_t = 'X'
TABLES
vbpok_tab = hvbpok.
nast = sav_nast.
* Freigabe an Datenbank
* COMMIT WORK.
ENDFORM. "delivery_update
* FORM get_comm *
* --> US_SCREEN Output on screen *
* ' ' = printer *
* 'X' = screen *
* --> US_COUNTRY County for telecommunication and SET COUNTRY *
FORM get_comm USING us_screen us_country.
DATA: lvs_itcpo TYPE itcpo,
lvf_device(30) TYPE c,
lvf_dialog(1) TYPE c VALUE ' ',
lvs_recipient LIKE swotobjid,
lvs_sender LIKE swotobjid,
lvs_snast TYPE snast,
lvf_program LIKE sy-repid,
lvs_comm_type TYPE ad_comm,
lvs_comm_values TYPE szadr_comm_values.
* reset return code
retcode = 0.
* if there is a communication strategy used ...
IF NOT nast-tcode IS INITIAL.
* ... use stratagy to get communication type
CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
EXPORTING
strategy = nast-tcode
* ADDRESS_TYPE =
* ADDRESS_NUMBER = VBDKA-ADRNR
* PERSON_NUMBER = VBDKA-ADRNP
address_number = addr_key-addrnumber
person_number = addr_key-persnumber
IMPORTING
comm_type = lvs_comm_type
comm_values = lvs_comm_values
* TABLES
* STRATEGY_TABLE =
EXCEPTIONS
address_not_exist = 1
person_not_exist = 2
no_comm_type_found = 3
internal_error = 4
parameter_error = 5
OTHERS = 6.
IF sy-subrc <> 0.
retcode = sy-subrc.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
ENDIF.
* convert communication data
MOVE-CORRESPONDING nast TO lvs_snast.
MOVE sy-repid TO lvf_program.
CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
EXPORTING
pi_comm_type = lvs_comm_type
pi_comm_values = lvs_comm_values
pi_screen = us_screen
* PI_NEWID =
pi_country = us_country
pi_repid = lvf_program
pi_snast = lvs_snast
IMPORTING
pe_itcpo = lvs_itcpo
pe_device = lvf_device
pe_mail_recipient = lvs_recipient
pe_mail_sender = lvs_sender
EXCEPTIONS
comm_type_not_supported = 1
recipient_creation_failed = 2
sender_creation_failed = 3
OTHERS = 4.
IF sy-subrc <> 0.
retcode = sy-subrc.
syst-msgty = 'E'.
PERFORM protocol_update.
ENDIF.
CHECK retcode EQ 0.
* if there is no communication type
IF lvs_comm_type IS INITIAL.
* set device
CASE nast-nacha.
WHEN '1'.
lvf_device = 'PRINTER'.
WHEN '2'.
lvf_device = 'TELEFAX'.
lvs_itcpo-tdtelenum = nast-telfx.
IF nast-tland IS INITIAL.
lvs_itcpo-tdteleland = us_country.
ELSE.
lvs_itcpo-tdteleland = nast-tland.
ENDIF.
lvs_itcpo-tdsenddate = nast-vsdat.
lvs_itcpo-tdsendtime = nast-vsura.
lvs_itcpo-tdfaxuser = nast-usnam.
WHEN '3'.
lvf_device = 'TELETEX'.
lvs_itcpo-tdtelenum = nast-teltx.
IF nast-tland IS INITIAL.
lvs_itcpo-tdteleland = us_country.
ELSE.
lvs_itcpo-tdteleland = nast-tland.
ENDIF.
lvs_itcpo-tdsenddate = nast-vsdat.
lvs_itcpo-tdsendtime = nast-vsura.
WHEN '4'.
lvf_device = 'TELEX'.
lvs_itcpo-tdtelenum = nast-telx1.
IF nast-tland IS INITIAL.
lvs_itcpo-tdteleland = us_country.
ELSE.
lvs_itcpo-tdteleland = nast-tland.
ENDIF.
lvs_itcpo-tdsenddate = nast-vsdat.
lvs_itcpo-tdsendtime = nast-vsura.
WHEN OTHERS.
lvf_device = 'PRINTER'.
ENDCASE.
ENDIF.
* fill structure itcpo
itcpo = lvs_itcpo.
SET COUNTRY us_country.
* include rvadopfo.
ENDFORM. "get_comm
* FORM GET_DATA *
* General provision of data for the form *
FORM get_data.
DATA: vblkp_lines TYPE p.
* Beschaffen View
xvbeln = nast-objky.
CALL FUNCTION 'RV_DELIVERY_PICK_VIEW'
EXPORTING
vbeln = xvbeln
zweck = 'D'
spras = nast-spras
IMPORTING
vblkk_wa = vblkk
TABLES
vblkp_tab = tvblkp
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
PERFORM protocol_update.
ENDIF.
* gibt es zu kommissionierende Positionen, ggf. sortieren
DESCRIBE TABLE tvblkp LINES vblkp_lines.
IF vblkp_lines GT 0.
* Nummernvergabe Kommissionierauftrag
CLEAR vblkk-komau.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'SD_PICKING'
IMPORTING
number = vblkk-komau
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ENDIF.
IF vblkk-komau IS INITIAL.
vblkk-komau = sy-datum+2.
vblkk-komau+6(4) = sy-uzeit(4).
ENDIF.
PERFORM sort_pick_list.
retcode = 0.
ELSE.
retcode = 4.
syst-msgid = 'VN'.
syst-msgno = '202'.
syst-msgty = 'E'.
syst-msgv1 = vblkk-vbeln.
PERFORM protocol_update.
CHECK 1 = 2.
ENDIF.
* Lesen Versandstelle
IF vblkk-vstel EQ space.
CLEAR: tvst, tvstt.
ELSE.
SELECT SINGLE * FROM tvst WHERE vstel EQ vblkk-vstel.
IF sy-subrc NE 0.
CLEAR tvst.
syst-msgid = 'VN'.
syst-msgno = '203'.
syst-msgty = 'E'.
syst-msgv1 = 'TVST'.
syst-msgv2 = syst-subrc.
PERFORM protocol_update.
ENDIF.
SELECT SINGLE * FROM tvstt WHERE spras EQ nast-spras
AND vstel EQ vblkk-vstel.
IF sy-subrc NE 0.
CLEAR tvstt.
syst-msgid = 'VN'.
syst-msgno = '203'.
syst-msgty = 'E'.
syst-msgv1 = 'TVSTT'.
syst-msgv2 = syst-subrc.
PERFORM protocol_update.
ENDIF.
ENDIF.
ENDFORM. "get_data
* FORM GET_SERIAL_NO *
* In this routine the serialnumbers are fetched from the *
* database. *
FORM get_serial_no.
REFRESH tsernr.
REFRESH tsernr_print.
CHECK vblkp-anzsn > 0.
* Read the Serialnumbers of a Position.
CALL FUNCTION 'SERIAL_LS_PRINT'
EXPORTING
vbeln = vblkp-vbeln
posnr = vblkp-posnr
TABLES
iserls = tsernr.
* Process the stringtable for Printing.
CALL FUNCTION 'PROCESS_SERIALS_FOR_PRINT'
EXPORTING
i_boundary_left = '(_'
i_boundary_right = '_)'
i_sep_char_strings = ',_'
i_sep_char_interval = '_-_'
i_use_interval = 'X'
i_boundary_method = 'C'
i_line_length = 50
i_no_zero = 'X'
i_alphabet = sy-abcde
i_digits = '0123456789'
i_special_chars = '-'
i_with_second_digit = ' '
TABLES
serials = tsernr
serials_print = tsernr_print
EXCEPTIONS
boundary_missing = 01
interval_separation_missing = 02
length_to_small = 03
internal_error = 04
wrong_method = 05
wrong_serial = 06
two_equal_serials = 07
serial_with_wrong_char = 08
serial_separation_missing = 09.
IF sy-subrc NE 0.
PERFORM protocol_update.
ENDIF.
ENDFORM. "get_serial_no
* FORM SMARTFORM_PRINT
FORM smartform_print.
DATA: e_werks LIKE tvblkp-werks VALUE ' ',
e_lgort LIKE tvblkp-lgort VALUE ' ',
e_lgnum LIKE tvblkp-lgnum VALUE ' ',
e_mbdat LIKE tvblkp-mbdat VALUE IS INITIAL.
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: ls_control_param TYPE ssfctrlop.
DATA: ls_composer_param TYPE ssfcompop.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
DATA: lf_formname TYPE tdsfname.
DATA: ls_addr_key LIKE addr_key.
CLEAR retcode.
* nast_key = objky.
PERFORM set_print_param USING ls_addr_key
CHANGING ls_control_param
ls_composer_param
ls_recipient
ls_sender
retcode.
*Get the Smart Form name.
IF NOT tnapr-sform IS INITIAL.
lf_formname = tnapr-sform.
ELSE.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
* 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.
IF sy-subrc <> 0.
* error handling
retcode = sy-subrc.
IF sy-subrc = 1.
MESSAGE e001(/smb40/ssfcomposer).
ENDIF.
IF sy-subrc = 2.
MESSAGE e002(/smb40/ssfcomposer).
ENDIF.
PERFORM protocol_update.
ENDIF.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
* ARCHIVE_INDEX_TAB =
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 = ' '
vblkk = vblkk
TABLES
tvblkp = tvblkp
* 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
IF sy-subrc <> 0.
retcode = sy-subrc.
PERFORM protocol_update.
* get SmartForm protocoll and store it in the NAST protocoll
PERFORM add_smfrm_prot.
ENDIF.
ENDFORM. "smartform_print
* FORM PROTOCOL_UPDATE *
* The messages are collected for the processing protocol. *
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
* FORM SENDER *
* This routine determines the address of the sender (Table VBUR)*
FORM user_exit1.
ENDFORM. "user_exit1
INCLUDE /smb40/mv50bfz1.
*include mv50bfz1.
*& Form set_print_param
* text
* -->P_LS_ADDR_KEY text
* <--P_LS_CONTROL_PARAM text
* <--P_LS_COMPOSER_PARAM text
* <--P_LS_RECIPIENT text
* <--P_LS_SENDER text
* <--P_RETCO text
FORM set_print_param USING is_addr_key LIKE addr_key
CHANGING cs_control_param TYPE ssfctrlop
cs_composer_param TYPE ssfcompop
cs_recipient TYPE swotobjid
cs_sender TYPE swotobjid
cf_retcode TYPE sy-subrc.
DATA: ls_itcpo TYPE itcpo.
DATA: lf_repid TYPE sy-repid.
DATA: lf_device TYPE tddevice.
DATA: ls_recipient TYPE swotobjid.
DATA: ls_sender TYPE swotobjid.
lf_repid = sy-repid.
IF itcpo IS INITIAL.
CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
EXPORTING
pi_nast = nast
pi_addr_key = is_addr_key
pi_repid = lf_repid
IMPORTING
pe_returncode = cf_retcode
pe_itcpo = ls_itcpo
pe_device = lf_device
pe_recipient = cs_recipient
pe_sender = cs_sender.
IF cf_retcode = 0.
MOVE-CORRESPONDING ls_itcpo TO cs_composer_param.
* CS_CONTROL_PARAM-NO_OPEN
* CS_CONTROL_PARAM-NO_CLOSE
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-preview = xscreen.
cs_control_param-getotf = ls_itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
* CS_CONTROL_PARAM-REPLANGU1
* CS_CONTROL_PARAM-REPLANGU2
* CS_CONTROL_PARAM-REPLANGU3
* CS_CONTROL_PARAM-STARTPAGE
ENDIF.
ELSE.
MOVE-CORRESPONDING itcpo TO cs_composer_param.
* CS_CONTROL_PARAM-NO_OPEN
* CS_CONTROL_PARAM-NO_CLOSE
cs_control_param-device = lf_device.
cs_control_param-no_dialog = 'X'.
cs_control_param-preview = xscreen.
cs_control_param-getotf = itcpo-tdgetotf.
cs_control_param-langu = nast-spras.
* CS_CONTROL_PARAM-REPLANGU1
* CS_CONTROL_PARAM-REPLANGU2
* CS_CONTROL_PARAM-REPLANGU3
* CS_CONTROL_PARAM-STARTPAGE
ENDIF.
ENDFORM. " set_print_param
**& Form protocol_update_i
** text
** --> p1 text
** <-- p2 text
*form protocol_update_i.
* 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_i
*& Form add_smfrm_prot
* text
* --> p1 text
* <-- p2 text
FORM add_smfrm_prot.
DATA: lt_errortab TYPE tsferror.
DATA: lf_msgnr TYPE sy-msgno.
DATA: l_s_log TYPE bal_s_log,
p_loghandle TYPE balloghndl,
l_s_msg TYPE bal_s_msg.
FIELD-SYMBOLS: <fs_errortab> TYPE LINE OF tsferror.
* get smart form protocoll
CALL FUNCTION 'SSF_READ_ERRORS'
IMPORTING
errortab = lt_errortab.
* add smartform protocoll to nast protocoll
LOOP AT lt_errortab ASSIGNING <fs_errortab>.
CLEAR lf_msgnr.
lf_msgnr = <fs_errortab>-errnumber.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = <fs_errortab>-msgid
msg_nr = lf_msgnr
msg_ty = <fs_errortab>-msgty
msg_v1 = <fs_errortab>-msgv1
msg_v2 = <fs_errortab>-msgv2
msg_v3 = <fs_errortab>-msgv3
msg_v4 = <fs_errortab>-msgv4
EXCEPTIONS
OTHERS = 1.
ENDLOOP.
* open the application log
l_s_log-extnumber = sy-uname.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = l_s_log
IMPORTING
e_log_handle = p_loghandle
EXCEPTIONS
OTHERS = 1.
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 lt_errortab ASSIGNING <fs_errortab>.
MOVE-CORRESPONDING <fs_errortab> TO l_s_msg.
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = p_loghandle
i_s_msg = l_s_msg
EXCEPTIONS
OTHERS = 1.
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 'BAL_DSP_LOG_DISPLAY'.
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. " add_smfrm_prot -
Hi,
there is someone could post me the code of the program /SMB40/FM06P (print program for best-practice smartforms Request Order) ?
I have lost the source of the code during the upgrade from ECC 5.0 to ECC 6.0.
(the version of the ECC 5.0).
Thanks
Fred.Hi Frederic Girod,
Here i'm sending the code for program /SMB40/FM06P.
Subroutine pool /SMB40/FM06P
Smart Form Print Program *
*Data
INCLUDE /SMB40/FM06TOP.
Subroutines for the Print Program
INCLUDE /SMB40/FM06PE02.
program /smb40/fm06p message-id me.
type-pools: addi, meein,
mmpur.
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
type-pools szadr.
tables : varposr,
rwerter,
mtxh.
data umbruch type i value 4.
data headerflag.
data begin of vartab occurs 15.
include structure varposr.
data end of vartab.
data tabn type i.
data taba type i.
data ebelph like ekpo-ebelp.
data bis type i.
data xmax type i.
data tab like varposr-yzeile.
data diff type i.
data ldat_sam like eket-eindt.
data: s, v type i.
data: sampr like pekpov-netpr, varpr like pekpov-netpr.
Struktur zur Variantenbildung
data: begin of wertetab occurs 30.
include structure rwerter.
data: atzhl like econf_out-atzhl,
end of wertetab.
Interne Tabelle fuer Konditionen
data: begin of kond occurs 30.
include structure komvd.
data: end of kond.
Hilfsfelder
data:
merknamex(15) type c, "Merkmalname x-Achse
merknamey(15) type c, "Merkmalname y-Achse
merknrx like rwerter-nr, "Int. Merkmal x-Achse
merknry like rwerter-nr, "Int. Merkmal y-Achse
i type i value 1,
nr like cawn-atinn.
data: inserterror(1),sum type i,menge type i,gsumh type i, xmaxh type i.
data: gsumv type i.
Matrixflag
data: m_flag value 'x'.
*- Tabellen -
tables: cpkme,
ekvkp,
ekko,
pekko,
rm06p,
ekpo,
pekpo,
pekpov,
pekpos,
eket,
ekek,
ekes,
ekeh,
ekkn,
ekpa,
ekbe,
eine, *eine,
lfa1,
likp,
*lfa1,
kna1,
komk,
komp,
komvd,
ekomd,
econf_out,
thead, *thead,
sadr,
mdpa,
mdpm,
mkpf,
tinct,
ttxit,
tmsi2,
tq05,
tq05t,
t001,
t001w,
t006, *t006,
t006a, *t006a,
t024,
t024e,
t027a,
t027b,
t052,
t161n,
t163d,
t166a,
t165p,
t166c,
t166k,
t166p,
t166t,
t166u,
t165m,
t165a,
tmamt,
*mara, "HTN 4.0C
mara,
marc,
mt06e,
makt,
vbak,
vbkd,
*vbkd,
vbap.
tables: drad,
drat.
tables: addr1_sel,
addr1_val.
tables: v_htnm, rampl,tmppf. "HTN-Abwicklung
tables: stxh. "schnellerer Zugriff auf Texte Dienstleistung
tables: t161. "Abgebotskennzeichen für Dienstleistung
*- INTERNE TABELLEN -
*- Tabelle der Positionen -
data: begin of xekpo occurs 10.
include structure ekpo.
data: bsmng like ekes-menge,
end of xekpo.
*- Key für xekpo -
data: begin of xekpokey,
mandt like ekpo-mandt,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
end of xekpokey.
*- Tabelle der Einteilungen -
data: begin of xeket occurs 10.
include structure eket.
data: fzete like pekpo-wemng,
end of xeket.
*- Tabelle der Einteilungen temporär -
data: begin of teket occurs 10.
include structure beket.
data: end of teket.
data: begin of zeket.
include structure eket.
data: end of zeket.
*- Tabelle der Positionszusatzdaten -
data: begin of xpekpo occurs 10.
include structure pekpo.
data: end of xpekpo.
*- Tabelle der Positionszusatzdaten -
data: begin of xpekpov occurs 10.
include structure pekpov.
data: end of xpekpov.
*- Tabelle der Zahlungbedingungen----
data: begin of zbtxt occurs 5,
line(50),
end of zbtxt.
*- Tabelle der Merkmalsausprägungen -
data: begin of tconf_out occurs 50.
include structure econf_out.
data: end of tconf_out.
*- Tabelle der Konditionen -
data: begin of tkomv occurs 50.
include structure komv.
data: end of tkomv.
data: begin of tkomk occurs 1.
include structure komk.
data: end of tkomk.
data: begin of tkomvd occurs 50. "Belegkonditionen
include structure komvd.
data: end of tkomvd.
data: begin of tekomd occurs 50. "Stammkonditionen
include structure ekomd.
data: end of tekomd.
*- Tabelle der Bestellentwicklung -
data: begin of xekbe occurs 10.
include structure ekbe.
data: end of xekbe.
*- Tabelle der Bezugsnebenkosten -
data: begin of xekbz occurs 10.
include structure ekbz.
data: end of xekbz.
*- Tabelle der WE/RE-Zuordnung -
data: begin of xekbez occurs 10.
include structure ekbez.
data: end of xekbez.
*- Tabelle der Positionssummen der Bestellentwicklung -
data: begin of tekbes occurs 10.
include structure ekbes.
data: end of tekbes.
*- Tabelle der Bezugsnebenkosten der Bestandsführung -
data: begin of xekbnk occurs 10.
include structure ekbnk.
data: end of xekbnk.
- Tabelle für Kopieren Positionstexte (hier wegen Infobestelltext) ---
data: begin of xt165p occurs 10.
include structure t165p.
data: end of xt165p.
*- Tabelle der Kopftexte -
data: begin of xt166k occurs 10.
include structure t166k.
data: end of xt166k.
*- Tabelle der Positionstexte -
data: begin of xt166p occurs 10.
include structure t166p.
data: end of xt166p.
*- Tabelle der Anahngstexte -
data: begin of xt166a occurs 10.
include structure t166a.
data: end of xt166a.
*- Tabelle der Textheader -
data: begin of xthead occurs 10.
include structure thead.
data: end of xthead.
data: begin of xtheadkey,
tdobject like thead-tdobject,
tdname like thead-tdname,
tdid like thead-tdid,
end of xtheadkey.
data: begin of qm_text_key occurs 5,
tdobject like thead-tdobject,
tdname like thead-tdname,
tdid like thead-tdid,
tdtext like ttxit-tdtext,
end of qm_text_key.
*- Tabelle der Nachrichten alt/neu -
data: begin of xnast occurs 10.
include structure nast.
data: end of xnast.
data: begin of ynast occurs 10.
include structure nast.
data: end of ynast.
*------ Struktur zur Übergabe der Adressdaten -
data: begin of addr_fields.
include structure sadrfields.
data: end of addr_fields.
*------ Struktur zur Übergabe der Adressreferenz -
data: begin of addr_reference.
include structure addr_ref.
data: end of addr_reference.
*------ Tabelle zur Übergabe der Fehler -
data: begin of error_table occurs 10.
include structure addr_error.
data: end of error_table.
*------ Tabelle zur Übergabe der Adressgruppen -
data: begin of addr_groups occurs 3.
include structure adagroups.
data: end of addr_groups.
*- Tabelle der Aenderungsbescheibungen -
data: begin of xaend occurs 10,
ebelp like ekpo-ebelp,
zekkn like ekkn-zekkn,
etenr like eket-etenr,
ctxnr like t166c-ctxnr,
rounr like t166c-rounr,
insert,
flag_adrnr,
end of xaend.
data: begin of xaendkey,
ebelp like ekpo-ebelp,
zekkn like ekkn-zekkn,
etenr like eket-etenr,
ctxnr like t166c-ctxnr,
rounr like t166c-rounr,
insert,
flag_adrnr,
end of xaendkey.
*- Tabelle der Textänderungen -
data: begin of xaetx occurs 10,
ebelp like ekpo-ebelp,
textart like cdshw-textart,
chngind like cdshw-chngind,
end of xaetx.
*- Tabelle der geänderten Adressen -
data: begin of xadrnr occurs 5,
adrnr like sadr-adrnr,
tname like cdshw-tabname,
fname like cdshw-fname,
end of xadrnr.
*- Tabelle der gerade bearbeiteten aktive Komponenten -
data begin of mdpmx occurs 10.
include structure mdpm.
data end of mdpmx.
*- Tabelle der gerade bearbeiteten Sekundärbedarfe -
data begin of mdsbx occurs 10.
include structure mdsb.
data end of mdsbx.
*- Struktur des Archivobjekts -
data: begin of xobjid,
objky like nast-objky,
arcnr like nast-optarcnr,
end of xobjid.
Struktur für zugehörigen Sammelartikel
data: begin of sekpo.
include structure ekpo.
data: first_varpos,
end of sekpo.
*- Struktur für Ausgabeergebnis zB Spoolauftragsnummer -
data: begin of result.
include structure itcpp.
data: end of result.
*- Struktur für Internet NAST -
data: begin of intnast.
include structure snast.
data: end of intnast.
*- HTN-Abwicklung
data: begin of htnmat occurs 0.
include structure v_htnm.
data: revlv like rampl-revlv,
end of htnmat.
data htnamp like rampl occurs 0 with header line.
*- Hilfsfelder -
data: hadrnr(8), "Key TSADR
elementn(30), "Name des Elements
save_el(30), "Rettfeld für Element
retco like sy-subrc, "Returncode Druck
insert, "Kz. neue Position
h-ind like sy-tabix, "Hilfsfeld Index
h-ind1 like sy-tabix, "Hilfsfeld Index
f1 type f, "Rechenfeld
h-menge like ekpo-menge, "Hilfsfeld Mengenumrechnung
h-meng1 like ekpo-menge, "Hilfsfeld Mengenumrechnung
h-meng2 like ekpo-menge, "Hilfsfeld Mengenumrechnung
ab-menge like ekes-menge, "Hilfsfeld bestätigte Menge
kzbzg like konp-kzbzg, "Staffeln vorhanden?
hdatum like eket-eindt, "Hilfsfeld Datum
hmahnz like ekpo-mahnz, "Hilfsfeld Mahnung
addressnum like ekpo-adrn2, "Hilfsfeld Adressnummer
tablines like sy-tabix, "Zähler Tabelleneinträge
entries like sy-tfill, "Zähler Tabelleneinträge
hstap, "statistische Position
hsamm, "Positionen mit Sammelartikel
hloep, "Gelöschte Positionen im Spiel
hkpos, "Kondition zu löschen
kopfkond, "Kopfkonditionen vorhanden
no_zero_line, "keine Nullzeilen
xdrflg like t166p-drflg, "Hilfsfeld Textdruck
xprotect, "Kz. protect erfolgt
archiv_object like toa_dara-ar_object, "für opt. Archivierung
textflag, "Kz. druckrel. Positionstexte
flag, "allgemeines Kennzeichen
spoolid(10), "Spoolidnummer
xprogram like sy-repid, "Programm
lvs_recipient like swotobjid, "Internet
lvs_sender like swotobjid, "Internet
timeflag, "Kz. Uhrzeit bei mind. 1 Eint.
h_vbeln like vbak-vbeln,
h_vbelp like vbap-posnr.
*- Drucksteuerung -
data: aendernsrv.
data: xdruvo. "Druckvorgang
data: neu value '1', "Neudruck
aend value '2', "Änderungsdruck
mahn value '3', "Mahnung
absa value '4', "Absage
lpet value '5', "Lieferplaneinteilung
lpma value '6', "Mahnung Lieferplaneinteilung
aufb value '7', "Auftragsbestätigung
lpae value '8', "Änderung Lieferplaneinteilung
lphe value '9', "Historisierte Einteilungen
preisdruck, "Kz. Gesamtpreis drucken
kontrakt_preis, "Kz. Kontraktpreise drucken
we value 'E'. "Wareneingangswert
*- Hilfsfelder Lieferplaneinteilung -
data:
xlpet, "Lieferplaneinteilung
xfz, "Fortschrittszahlendarstellung
xoffen, "offene WE-Menge
xlmahn, "Lieferplaneinteilungsmahnung
fzflag, "KZ. Abstimmdatum erreicht
xnoaend, "keine Änderungsbelege da LPET
xetdrk, "Druckrelevante Positionen da LPET
xetefz like eket-menge, "Einteilungsfortschrittszahl
xwemfz like eket-menge, "Lieferfortschrittszahl
xabruf like ekek-abruf, "Alter Abruf
p_abart like ekek-abart. "Abrufart
*data: sum-euro-price like komk-fkwrt. "302203
data: sum-euro-price like komk-fkwrt_euro. "302203
data: euro-price like ekpo-effwr.
*- Hilfsfelder für Ausgabemedium -
data: xdialog, "Kz. POP-UP
xscreen, "Kz. Probeausgabe
xformular like tnapr-fonam, "Formular
xdevice(10). "Ausgabemedium
*- Hilfsfelder für QM -
data: qv_text_i like tq09t-kurztext, "Bezeichnung Qualitätsvereinb.
tl_text_i like tq09t-kurztext, "Bezeichnung Technische Lieferb.
zg_kz. "Zeugnis erforderlich
*- Hilfsfelder für Änderungsbeleg -
data: objectid like cdhdr-objectid,
tcode like cdhdr-tcode,
planned_change_number like cdhdr-planchngnr,
utime like cdhdr-utime,
udate like cdhdr-udate,
username like cdhdr-username,
cdoc_planned_or_real like cdhdr-change_ind,
cdoc_upd_object like cdhdr-change_ind value 'U',
cdoc_no_change_pointers like cdhdr-change_ind.
*- Common-Part für Änderungsbeleg -
*include zzfm06lccd.
data: begin of common part fm06lccd.
*------- Tabelle der Änderunsbelegzeilen (temporär) -
data: begin of edit occurs 50. "Änderungsbelegzeilen temp.
include structure cdshw.
data: end of edit.
data: begin of editd occurs 50. "Änderungsbelegzeilen temp.
include structure cdshw. "für Dienstleistungen
data: end of editd.
*------- Tabelle der Änderunsbelegzeilen (Ausgabeform) -
data: begin of ausg occurs 50. "Änderungsbelegzeilen
include structure cdshw.
data: changenr like cdhdr-changenr,
udate like cdhdr-udate,
utime like cdhdr-utime,
end of ausg.
*------- Tabelle der Änderunsbelegköpfe -
data: begin of icdhdr occurs 50. "Änderungbelegköpfe
include structure cdhdr.
data: end of icdhdr.
*------- Key Tabelle der Änderunsbelegköpfe -
data: begin of hkey, "Key für ICDHDR
mandt like cdhdr-mandant,
objcl like cdhdr-objectclas,
objid like cdhdr-objectid,
chang like cdhdr-changenr,
end of hkey.
*------- Key der geänderten Tabelle für Ausgabe -
data: begin of ekkey, "Tabellenkeyausgabe
ebeln like ekko-ebeln,
ebelp like ekpo-ebelp,
zekkn like ekkn-zekkn,
etenr like eket-etenr,
abruf like ekek-abruf,
ekorg like ekpa-ekorg, "Änderungsbelege Partner
ltsnr like ekpa-ltsnr, "Änderungsbelege Partner
werks like ekpa-werks, "Änderungsbelege Partner
parvw like ekpa-parvw, "Änderungsbelege Partner
parza like ekpa-parza, "Änderungsbelege Partner
consnumber like adr2-consnumber, "Änderungsbelege Adressen
comm_type like adrt-comm_type, "Änderungsbelege Adressen
end of ekkey.
data: end of common part.
*- Direktwerte -
Direktwerte *
*------- Werte zu Trtyp und Aktyp:
constants: hin value 'H', "Hinzufuegen
ver value 'V', "Veraendern
anz value 'A', "Anzeigen
erw value 'E'. "Bestellerweiterung
constants:
BSTYP
bstyp-info value 'I',
bstyp-ordr value 'W',
bstyp-banf value 'B',
bstyp-best value 'F',
bstyp-anfr value 'A',
bstyp-kont value 'K',
bstyp-lfpl value 'L',
bstyp-lerf value 'Q',
BSAKZ
bsakz-norm value ' ',
bsakz-tran value 'T',
bsakz-rahm value 'R',
BSAKZ-BEIS VALUE 'B', "not used
BSAKZ-KONS VALUE 'K', "not used
BSAKZ-LOHN VALUE 'L', "not used
BSAKZ-STRE VALUE 'S', "not used
BSAKZ-MENG VALUE 'M', "not used
BSAKZ-WERT VALUE 'W', "not used
PSTYP
pstyp-lagm value '0',
pstyp-blnk value '1',
pstyp-kons value '2',
pstyp-lohn value '3',
pstyp-munb value '4',
pstyp-stre value '5',
pstyp-text value '6',
pstyp-umlg value '7',
pstyp-wagr value '8',
pstyp-dien value '9',
Kzvbr
kzvbr-anla value 'A',
kzvbr-unbe value 'U',
kzvbr-verb value 'V',
kzvbr-einz value 'E',
kzvbr-proj value 'P',
ESOKZ
esokz-pipe value 'P',
esokz-lohn value '3',
esokz-konsi value '2', "konsi
esokz-charg value '1', "sc-jp
esokz-norm value '0'.
constants:
Handling von Unterpositionsdaten
sihan-nix value ' ', "keine eigenen Daten
sihan-anz value '1', "Daten aus Hauptposition kopiert, nicht änd
sihan-kop value '2', "Daten aus Hauptposition kopiert, aber ände
sihan-eig value '3'. "eigene Daten (nicht aus Hauptposition kopi
Unterpositionstypen
constants:
uptyp-hpo value ' ', "Hauptposition
uptyp-var value '1', "Variante
uptyp-nri value '2', "Naturalrabatt Inklusive (=Dreingabe)
uptyp-ler value '3', "Leergut
uptyp-nre value '4', "Naturalrabatt Exklusive (=Draufgabe)
uptyp-lot value '5', "Lot Position
uptyp-dis value '6', "Display Position
uptyp-vks value '7', "VK-Set Position
uptyp-mpn value '8', "Austauschposition (A&D)
uptyp-sls value '9', "Vorkommisionierungsposition (retail)
uptyp-div value 'X'. "HP hat UP's mit verschiedenen Typen
Artikeltypen
constants:
attyp-sam(2) value '01', "Sammelartikel
attyp-var(2) value '02', "Variante
attyp-we1(2) value '20', "Wertartikel
attyp-we2(2) value '21', "Wertartikel
attyp-we3(2) value '22', "Wertartikel
attyp-vks(2) value '10', "VK-Set
attyp-lot(2) value '11', "Lot-Artikel
attyp-dis(2) value '12'. "Display
Konfigurationsherkunft
constants:
kzkfg-fre value ' ', "Konfiguration sonst woher
kzkfg-kan value '1', "noch nicht konfiguriert
kzkfg-eig value '2'. "Eigene Konfiguration
constants:
c_ja type c value 'X',
c_nein type c value ' '.
Vorgangsart, welche Anwendung den Fkt-Baustein aufruft
constants:
cva_ab(1) value 'B', "Automatische bestellung (aus banfen)
cva_we(1) value 'C', "Wareneingang
cva_bu(1) value 'D', "Übernahme bestellungen aus fremdsystem
cva_au(1) value 'E', "Aufteiler
cva_kb(1) value 'F', "Kanban
cva_fa(1) value 'G', "Filialauftrag
cva_dr(1) value 'H', "DRP
cva_en(1) value '9', "Enjoy
cva_ap(1) value '1', "APO
cva_ed(1) value 'T'. "EDI-Eingang Auftragsbestätigung Update Preis
Status des Einkaufsbeleges (EKKO-STATU)
constants:
cks_ag(1) value 'A', "Angebot vorhanden für Anfrage
cks_ab(1) value 'B', "Automatische Bestellung (aus Banfen) ME59
cks_we(1) value 'C', "Bestellung aus Wareneingang
cks_bu(1) value 'D', "Bestellung aus Datenübernahme
cks_au(1) value 'E', "Bestellung aus Aufteiler (IS-Retail)
cks_kb(1) value 'F', "Bestellung aus Kanban
cks_fa(1) value 'G', "Bestellung aus Filialauftrag (IS-Retail)
cks_dr(1) value 'H', "Bestellung aus DRP
cks_ba(1) value 'I', "Bestellung aus BAPI
cks_al(1) value 'J', "Bestellung aus ALE-Szenario
cks_sb(1) value 'S', "Sammelbestellung (IS-Retail)
cks_ap(1) value '1', "APO
cks_en(1) value '9', "Enjoy Bestellung
cks_fb(1) value 'X'. "Bestellung aus Funktionsbaustein
Vorgang aus T160
constants:
vorga-angb(2) value 'AG', "Angebot zur Anfrage ME47, ME48
vorga-lpet(2) value 'LE', "Lieferplaneinteilung ME38, ME39
vorga-frge(2) value 'EF', "Einkaufsbelegfreigabe ME28, ME35, ME45
vorga-frgb(2) value 'BF', "Banffreigabe ME54, ME55
vorga-bgen(2) value 'BB', "Best. Lief.unbekannt ME25
vorga-anha(2) value 'FT', "Textanhang ME24, ME26,...
vorga-banf(2) value 'B ', "Banf ME51, ME52, ME53
vorga-anfr(2) value 'A ', "Anfrage ME41, ME42, ME43
vorga-best(2) value 'F ', "Bestellung ME21, ME22, ME23
vorga-kont(2) value 'K ', "Kontrakt ME31, ME32, ME33
vorga-lfpl(2) value 'L ', "Lieferplan ME31, ME32, ME33
vorga-mahn(2) value 'MA', "Liefermahnung ME91
vorga-aufb(2) value 'AB'. "Bestätigungsmahnung ME92
Felder für Feldauswahl (früher FMMEXCOM)
data: endmaske(210) type c,
kmaske(140) type c,
auswahl0 type brefn,
auswahl1 type brefn,
auswahl2 type brefn,
auswahl3 type brefn,
auswahl4 type brefn,
auswahl5 type brefn,
auswahl6 type brefn.
Sonderbestandskennzeichen
constants:
sobkz-kdein value 'E', "Kundeneinzel
sobkz-prein value 'Q', "Projekteinzel
sobkz-lohnb value 'O'. "Lohnbearbeiterbeistell
Min-/Maxwerte für Datenelemente
constants:
offener Rechnungseingangswert / Feldlänge: 13 / Dezimalstellen: 2
c_max_orewr like rm06a-orewr value '99999999999.99',
c_max_orewr_f type f value '99999999999.99',
c_max_orewr_x(15) type c value '**************',
c_max_proz_p(3) type p decimals 2 value '999.99', "@80545
c_max_proz_x(6) type c value '******', "@80545
c_max_menge like ekpo-menge value '9999999999.999', "@83886
c_max_menge_f type f value '9999999999.999', "@83886
c_max_netwr like ekpo-netwr value '99999999999.99', "@83886
c_max_netwr_f type f value '99999999999.99'. "@83886
Distribution Indicator Account assignment
constants:
c_dist_ind-single value ' ', "no multiple = single
c_dist_ind-quantity value '1', "quantity distribution
c_dist_ind-percent value '2'. "percentag
Datendefinitionen für Dienstleistungen
tables: eslh,
esll,
ml_esll,
rm11p.
data begin of gliederung occurs 50.
include structure ml_esll.
data end of gliederung.
data begin of leistung occurs 50.
include structure ml_esll.
data end of leistung.
data return.
*- interne Tabelle für Abrufköpfe -
data: begin of xekek occurs 20.
include structure iekek.
data: end of xekek.
*- interne Tabelle für Abrufköpfe alt----
data: begin of pekek occurs 20.
include structure iekek.
data: end of pekek.
*- interne Tabelle für Abrufeinteilungen -
data: begin of xekeh occurs 20.
include structure iekeh.
data: end of xekeh.
*- interne Tabelle für Abrufeinteilungen -
data: begin of tekeh occurs 20.
include structure iekeh.
data: end of tekeh.
*- Zusatztabelle Abruf nicht vorhanden XEKPO----
data: begin of xekpoabr occurs 20,
mandt like ekpo-mandt,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
end of xekpoabr.
*-- Daten Hinweis 39234 -
*- Hilfstabelle Einteilungen -
data: begin of heket occurs 10.
include structure eket.
data: tflag like sy-calld,
end of heket.
*- Key für HEKET -
data: begin of heketkey,
mandt like eket-mandt,
ebeln like eket-ebeln,
ebelp like eket-ebelp,
etenr like eket-etenr,
end of heketkey.
data: h_subrc like sy-subrc,
h_tabix like sy-tabix,
h_field like cdshw-f_old,
h_eindt like rvdat-extdatum.
data z type i.
Defintionen für Formeln
type-pools msfo.
data: variablen type msfo_tab_variablen with header line.
data: formel type msfo_formel.
Definition für Rechnungsplan
data: tfpltdr like fpltdr occurs 0 with header line.
data: fpltdr like fpltdr.
Definiton Defaultschema für Dienstleistung
constants: default_kalsm like t683-kalsm value 'MS0000',
default_kalsm_stamm like t683-kalsm value 'MS0001'.
data: bstyp like ekko-bstyp,
bsart like ekko-bsart.
data dkomk like komk.
Defintion für Wartungsplan
tables: rmipm.
data: mpos_tab like mpos occurs 0 with header line,
zykl_tab like mmpt occurs 0 with header line.
data: print_schedule.
data: begin of d_tkomvd occurs 50.
include structure komvd.
data: end of d_tkomvd.
data: begin of d_tkomv occurs 50.
include structure komv.
data: end of d_tkomv.
Definition Drucktabellen blockweises Lesen
data: leistung_thead like stxh occurs 1 with header line.
data: gliederung_thead like stxh occurs 1 with header line. "HS
data: begin of thead_key,
mandt like sy-mandt,
tdobject like stxh-tdobject,
tdname like stxh-tdname,
tdid like stxh-tdid,
tdspras like stxh-tdspras.
data: end of thead_key.
ranges: r1_tdname for stxh-tdname,
r2_tdname for stxh-tdname.
data: begin of doktab occurs 0.
include structure drad.
data dktxt like drat-dktxt.
data: end of doktab.
Additionals Tabelle (CvB/4.0c)
data: l_addis_in_orders type line of addi_buying_print_itab
occurs 0 with header line.
Die Additionals-Strukturen müssen bekannt sein
tables: wtad_buying_print_addi, wtad_buying_print_extra_text.
data: ls_print_data_to_read type lbbil_print_data_to_read.
data: ls_bil_invoice type lbbil_invoice.
data: lf_fm_name type rs38l_fnam.
data: ls_control_param type ssfctrlop.
data: ls_composer_param type ssfcompop.
data: ls_recipient type swotobjid.
data: ls_sender type swotobjid.
data: lf_formname type tdsfname.
data: ls_addr_key like addr_key,
dunwitheket type xfeld.
data: l_zekko like ekko,
l_xpekko like pekko,
l_xekpo like table of ekpo,
l_wa_xekpo like ekpo.
data: l_xekpa like ekpa occurs 0,
l_wa_xekpa like ekpa.
data: l_xpekpo like pekpo occurs 0,
l_wa_xpekpo like pekpo,
l_xeket like table of eket with header line,
l_xekkn like table of ekkn with header line,
l_xekek like table of ekek with header line,
l_xekeh like table of ekeh with header line,
l_xkomk like table of komk with header line,
l_xtkomv type komv occurs 0,
l_wa_xtkomv type komv.
data ls_ssfcompop type ssfcompop.
*& Include /SMB40/FM06PE02
*& Form GET_PLANT_ADDRESS
FORM get_plant_address USING p_werks LIKE t001w-werks
CHANGING p_adrnr
p_sadr LIKE sadr.
parameter P_ADRNR without type since there are several address
fields with different domains
DATA: l_ekko LIKE ekko,
l_address LIKE addr1_val.
CHECK NOT p_werks IS INITIAL.
l_ekko-reswk = p_werks.
l_ekko-bsakz = 'T'.
CALL FUNCTION 'MM_ADDRESS_GET'
EXPORTING
i_ekko = l_ekko
IMPORTING
e_address = l_address
e_sadr = p_sadr.
p_adrnr = l_address-addrnumber.
ENDFORM. " GET_PLANT_ADDRESS
*& Form GET_CUSTOMER_ADDRESS
FORM get_customer_address USING p_kunnr LIKE ekpo-kunnr
CHANGING p_adrnr.
parameter P_ADRNR without type since there are several address
fields with different domains
DATA: l_adrnr LIKE kna1-adrnr.
CHECK NOT p_kunnr IS INITIAL.
SELECT SINGLE adrnr FROM kna1 INTO (l_adrnr)
WHERE kunnr = p_kunnr.
IF sy-subrc EQ 0.
p_adrnr = l_adrnr.
ELSE.
CLEAR p_adrnr.
ENDIF.
ENDFORM. " GET_CUSTOMER_ADDRESS
*& Form GET_VENDOR_ADDRESS
FORM get_vendor_address USING p_emlif LIKE lfa1-lifnr
CHANGING p_adrnr.
parameter P_ADRNR without type since there are several address
fields with different domains
DATA: l_lfa1 LIKE lfa1.
CHECK NOT p_emlif IS INITIAL.
CALL FUNCTION 'VENDOR_MASTER_DATA_SELECT_00'
EXPORTING
i_lfa1_lifnr = p_emlif
i_data = 'X'
i_partner = ' '
IMPORTING
a_lfa1 = l_lfa1
EXCEPTIONS
vendor_not_found = 1.
IF sy-subrc EQ 0.
p_adrnr = l_lfa1-adrnr.
ELSE.
CLEAR p_adrnr.
ENDIF.
ENDFORM. " GET_VENDOR_ADDRESS
*& Form get_addr_key
text
-->P_CS_BIL_INVOICE_HD_ADR text
<--P_CS_ADDR_KEY text
FORM get_addr_key
USING l_xekko LIKE ekko
CHANGING l_addr_key.
DATA: l_lfa1 LIKE lfa1.
IF l_xekko-lifnr NE space.
CALL FUNCTION 'MM_ADDRESS_GET'
EXPORTING
i_ekko = l_xekko
IMPORTING
e_sadr = sadr
EXCEPTIONS
OTHERS = 1.
MOVE-CORRESPONDING sadr TO l_lfa1.
IF sy-subrc = 0.
MOVE l_lfa1-adrnr TO ls_addr_key.
ENDIF.
ENDIF.
ENDFORM. " get_addr_key
*& Form protocol_update_I
text
--> p1 text
<-- p2 text
FORM protocol_update_i.
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_I
*& Form add_smfrm_prot
text
--> p1 text
<-- p2 text
FORM add_smfrm_prot.
DATA: lt_errortab TYPE tsferror.
DATA: lf_msgnr TYPE sy-msgno.
DATA: l_s_log TYPE bal_s_log,
p_loghandle TYPE balloghndl,
l_s_msg TYPE bal_s_msg.
FIELD-SYMBOLS: TYPE LINE OF tsferror.
get smart form protocoll
CALL FUNCTION 'SSF_READ_ERRORS'
IMPORTING
errortab = lt_errortab.
SORT lt_errortab.
delete adjacent duplicates from lt_errortab comparing errnumber.
add smartform protocoll to nast protocoll
LOOP AT lt_errortab ASSIGNING -msgv4
EXCEPTIONS
OTHERS = 1.
ENDLOOP.
open the application log
l_s_log-extnumber = sy-uname.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = l_s_log
IMPORTING
e_log_handle = p_loghandle
EXCEPTIONS
OTHERS = 1.
IF sy-subrc 0.
ENDIF.
ENDLOOP.
Function module to display error logs during
smart form processing
Notice , the function 'BAL_DSP_LOG_DISPLAY' can
not be used when you using output dispatch time
4 (Send immediately), so the statement is comment
out by default.
You can enable the function call statement
if your form can not be output and you want to
see the error log. Set output dispatch time to 3
before save your order, then print or preview the
output.
DATA lv_debug.
IF NOT lv_debug IS INITIAL.
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'.
ENDIF.
ENDFORM. " add_smfrm_prot
*& Form ENTRY_NEU
text
-->ENT_RETCO text
-->ENT_SCREEN text
FORM entry_neu USING ent_retco ent_screen.
DATA: l_druvo LIKE t166k-druvo.
DATA: ls_xfz TYPE char1.
xscreen = ent_screen.
CLEAR ent_retco.
IF nast-aende EQ space.
l_druvo = '1'.
ELSE.
l_druvo = '2'.
ENDIF.
*>>> Start of Insertion >>> OSS 754573 (Liu Ke)
IF xscreen EQ 'X' AND ( nast-tdarmod EQ '2' OR nast-tdarmod EQ '3').
nast-tdarmod = '1'.
ENDIF.
*<<< End of Insertion <<<
PERFORM processing_po USING nast ls_xfz
CHANGING ent_retco ent_screen l_druvo.
ENDFORM. "entry_neu -
Hi Experts,
We are getting the followiing error message and we arenot able to print any smartforms pages. It says :
Error cannot be classified (unknown exception triggered)
Message no. SSFCOMPOSER003
For your information, we have done some batch updation recently.
Will it be a cause for this problem.
Its a great mistake, we are not able to print any customized print pages in our company.
Please advise me on the same.
Thanks in advance.
Regards
Rajaram
Title was edited by:
Alvaro Tejada GalindoHi Raja
Summary
Symptom
In the processing log, the system generates error message 'Error cannot be classified (unknown exception triggered)' SSFCOMPOSER003.
Other terms
Smartform, ISAUTO_ESCR_FRC_JIT, ENTRY_LPHE_AUTO, ENTRY_LPJE_AUTO, LPH1,
LPJ1, ISAUTO_ESCR_PRINT_FRC_JIT, LISAUTO_ESCR_PRINTF08, SSF_READ_ERRORS
Reason and Prerequisites
During the output, entry routine ENTRY_LPHE_AUTO or ENTRY_LPJE_AUTO in combination with Smartform ISAUTO_ESCR_FRC_JIT is used.
Solution
Implement the attached correction instructions.
Header Data
Release Status: Released for Customer
Released on: 31.10.2002 12:09:04
Priority: Correction with low priority
Category: Program error
Primary Component: IS-A-EMM Enhancements Scheduling Agreements MM (Outbound)
Releases
Software
Component
Release
From
Release
To
Release
And
subsequent
DI
46C
46C2
46C2
Highest Implemented Support Package
Support
Packages
Release
Package
Name
DI
46C2
SAPKIPMD10
Corrections Instructions
Correction
Instruction
Valid
from
Valid
to
Software
Component
Type *)
Ref.
Correction
Last
Modifcation
474830
46C2
46C2
DI
C
PA8K021419
30.10.2002 15:35:09
*) C Korrektur, B Vorarbeit, A Nacharbeit, M noch nicht bestimmte Arbeit
Attributes
Attribute
Value
SAP objects
LISAUTO_ESCR_PRINTF08
Error messages
SSFCOMPOSER 003
Transaction codes
ME9E
Transaktionscodes - manuell
ME9E
SAP-Objekte - manuell
LISAUTO_ESCR_PRINTF08
Correction Instruction
Show all
General Information
Number 0000474830
Installation 0120061532 Package 60
Note 0000567778 - ME9E: Non-classifiable error in the output log
Software Component DI
Status Released
Date 30.10.2002 Time 16:35:09
Validity Details
Release Highest Implemented Support Package
46C2 46C2 - SAPKIPMD09
Reference Correction
System ID: PA8
Request/Task PA8K021419
TADIR Entries
Object Description TADIR Entry
Program ID Object Type Object Name Program ID Object Type Object Name
LIMU REPS LISAUTO_ESCR_PRINTF08 R3TR FUGR ISAUTO_ESCR_PRINT
<b>FORM ADD_SMFRM_PROT</b>
Delta 001
Context Block
<-- p2 text
FORM add_smfrm_prot.
DATA: lt_errortab TYPE tsferror.
Delete Block
DATA: lf_msgnr TYPE sy-msgno.
Insert Block
Delta 002
Context Block
CALL FUNCTION 'SSF_READ_ERRORS'
IMPORTING
errortab = lt_errortab.
add smartform protocoll to nast protocoll
LOOP AT lt_errortab ASSIGNING <fs_errortab>.
Delete Block
CLEAR lf_msgnr.
lf_msgnr = <fs_errortab>-errnumber.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = <fs_errortab>-msgid
msg_nr = lf_msgnr
Insert Block
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = <fs_errortab>-msgid
msg_nr = <fs_errortab>-msgno "567778
<b><REMOVED BY MODERATOR></b>
Regards
Pavan
Message was edited by:
Alvaro Tejada Galindo -
Medruck print program customizing
Hi,
I have a requirement from client.
In purchase order form is MEDRUCK presently is not displaying material conditions if any existing, my requirement is if any conditions existing to material in purchase order should display in script.
in print program or form where i have to change and what changes i have to do
it is very urgent plz. any body give sol.
Ganeshhi ganesh,
u saythat ur looking at write_form, thre is no logic in that i think u should first find where the material conditions exists and look at the form whreethese conditions are printed and make modifications aremade.
remember ur manipulations are done at form level and not at program level.
ur program is to hold all thedeclarations and control of nast and protocol updates only.
hope u understand this. -
i have copied a driver programe of outbound delivery and modified in such a way the layout will convert to pdf and then download to pc, but the driver program is not executing online, so do i need to attache the driver program name and form name in nace t.code or how would i execute the program, when i am placing a break point in driver program and execute form its not stopping at break point, i am new to forms, help me out in this.
i have placed the code below plz verify it and say if any thing is wrong in the code, u will be shurely rewareded.
Print of a delivery note by SAPscript SMART FORMS *
REPORT Z_RLE_DELNOTE1.
declaration of data
INCLUDE Z_RLE_DELNOTE_DATA_DECLARE1.
*INCLUDE RLE_DELNOTE_DATA_DECLARE.
definition of forms
INCLUDE Z_RLE_DELNOTE_FORMS1.
*INCLUDE RLE_DELNOTE_FORMS.
INCLUDE Z_RLE_PRINT_FORMS1.
*INCLUDE RLE_PRINT_FORMS.
FORM ENTRY
FORM ENTRY USING RETURN_CODE US_SCREEN.
DATA: LF_RETCODE TYPE SY-SUBRC.
XSCREEN = US_SCREEN.
PERFORM PROCESSING USING US_SCREEN
CHANGING LF_RETCODE.
IF LF_RETCODE NE 0.
RETURN_CODE = 1.
ELSE.
RETURN_CODE = 0.
ENDIF.
ENDFORM.
FORM PROCESSING *
FORM PROCESSING USING PROC_SCREEN
CHANGING CF_RETCODE.
DATA: LS_PRINT_DATA_TO_READ TYPE LEDLV_PRINT_DATA_TO_READ.
DATA: LS_DLV_DELNOTE TYPE LEDLV_DELNOTE.
DATA: LF_FM_NAME TYPE RS38L_FNAM.
DATA: LS_CONTROL_PARAM TYPE SSFCTRLOP.
DATA: LS_COMPOSER_PARAM TYPE SSFCOMPOP.
DATA: LS_RECIPIENT TYPE SWOTOBJID.
DATA: LS_SENDER TYPE SWOTOBJID.
DATA: LF_FORMNAME TYPE TDSFNAME.
DATA: LS_ADDR_KEY LIKE ADDR_KEY.
*Begin of changes by 67.
DATA: ls_document_output_info TYPE ssfcrespd,
ls_job_output_options TYPE ssfcresop.
*End of changes by 67.
SmartForm from customizing table TNAPR
LF_FORMNAME = TNAPR-SFORM.
determine print data
PERFORM SET_PRINT_DATA_TO_READ USING LF_FORMNAME
CHANGING LS_PRINT_DATA_TO_READ
CF_RETCODE.
IF CF_RETCODE = 0.
select print data
PERFORM GET_DATA USING LS_PRINT_DATA_TO_READ
CHANGING LS_ADDR_KEY
LS_DLV_DELNOTE
CF_RETCODE.
ENDIF.
IF CF_RETCODE = 0.
PERFORM SET_PRINT_PARAM USING LS_ADDR_KEY
CHANGING LS_CONTROL_PARAM
LS_COMPOSER_PARAM
LS_RECIPIENT
LS_SENDER
CF_RETCODE.
ENDIF.
*Begin of changes by 67.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = v_language
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
E_DEVTYPE = v_e_devtype
st_output_options-tdprinter = v_e_devtype.
*st_output_options-tdprinter = 'locl'.
LS_CONTROL_PARAM-no_dialog = 'X'.
LS_CONTROL_PARAM-getotf = 'X'.
*End of changes by 67.
IF CF_RETCODE = 0.
determine smartform function module for delivery note
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.
IF SY-SUBRC <> 0.
error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDIF.
IF CF_RETCODE = 0.
call smartform delivery note
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 = ' '
IS_DLV_DELNOTE = LS_DLV_DELNOTE
IS_NAST = NAST
*Begin of changes by 67.
importing
document_output_info = ls_document_output_info "67
job_output_info = tab_otf_data
job_output_options = ls_job_output_options "67
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
*End of changes by 67.
IF SY-SUBRC <> 0.
error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
get SmartForm protocoll and store it in the NAST protocoll
PERFORM ADD_SMFRM_PROT. "INS_HP_335958
ENDIF.
ENDIF.
get SmartForm protocoll and store it in the NAST protocoll
PERFORM ADD_SMFRM_PROT. DEL_HP_335958
--Function modules conversts from otf to pdf format.--
*Begin of chanes by 67.
CALL FUNCTION 'CONVERT_OTF_2_PDF'
EXPORTING
USE_OTF_MC_CMD = 'X'
ARCHIVE_INDEX =
IMPORTING
BIN_FILESIZE = v_bin_filesize
TABLES
otf = v_tab_otf_final
doctab_archive = v_it_docs
lines = v_it_lines
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 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 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = v_bin_filesize
filename = 'D:\67.PDF'
FILETYPE = 'BIN'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
IMPORTING
FILELENGTH = v_file_size
tables
data_tab = v_pdf_tab
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE i001(z00) WITH 'File not downloaded succesfully'.
else.
MESSAGE i002(z00) WITH 'File 67.PDF downloaded succesfully under D: drive'.
ENDIF.
*End of changes by 67.
ENDFORM.Hi,
Make sure that the output type you are using is configured for your custom-copied program name, form routine, and the form you are using. The output types can be found in transaction NACE.
Award points if found helpful.
Thanks,
Leo -
hi experts
i devepoled a form for a paricular document no.....in that if i give doc no and date i will get the items in that document no.......but i want in such a way that i will give range of document no's....all the recipts for that range should come one after the other...(on seperate papers)....................Hi!
This can be solved like the following:
You have to write a report program, which collects all the required documents and the required data.
When you have all data, write a coding into your program like this. The coding is unfinished and untested, but maybe gives you a good idea.
* determine smartform function module for delivery note
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING FORMNAME = LF_FORMNAME "your smartform
* variant = ' '
* direct_call = ' '
IMPORTING FM_NAME = LF_FM_NAME "sap FM for smartform
EXCEPTIONS NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
ENDIF.
ENDIF.
LOOP AT itab INTO wa_itab.
AT END OF doc_num.
IF CF_RETCODE = 0.
* call smartform delivery note
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 = ' '
IS_DLV_DELNOTE = LS_DLV_DELNOTE
IS_NAST = NAST
* 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.
IF SY-SUBRC <> 0.
* error handling
CF_RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.
* get SmartForm protocoll and store it in the NAST protocoll
PERFORM ADD_SMFRM_PROT. "INS_HP_335958
ENDIF.
ENDIF.
ENDAT.
ENDLOOP.
Maybe you are looking for
-
Urgent help needed to setup Forms 6i Server on Windows Server 2003
Hello, I am trying to install Forms 6i Server from the Forms/Reports 6i Release 2 CD onto a server with Windows Server 2003 Standard Editon (services pack 1) installed. The Oracle Installer produced the following error when I tried to install the For
-
Keep the Oracle Spatial data in memory
I can keep any database tables in memory (for fast access) using Oracle Coherence (the In Memory Data Grid). Now I want to store Oracle Spatial data in memory, is it possible?
-
Can anyone help me figure out why my div named "#indexThmbs" is not sitting flush to the div above it named "#indexHeader1" The purple body background color is coming through and I dont know why. There are no top/bottom margins on either divs so ther
-
Upgrade from OS X 10.6.8 to X Yosemite with 4GB memory, 2.26 GHz
Can a MacBook Pro that has OS X 10.6.8, 4GB memory, 2.26 GHz intel Core 2 Duo able to upgrade to X Yosemite and still run Word/Excel/PPT 12.3.6 without a problem? From previous posts I'm not sure I have enough memory. Thanks!
-
Trouble printing multiple pictures
can anyone help....we are able to set all of the pictures up for multiple printing (doing 3 4x6 on letter size paper), but then when we hit print nothing happens. It doesnt even look like the process is being sent to the printer because nothing comes