SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Smartform print program for goods return



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Smartforms, SapScripts, PDF
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Mon Oct 01, 2007 1:00 pm    Post subject: Smartform print program for goods return Reply with quote

You developed a Custome Smartform, it will give the output when you execute that Program, How come it is possible to give a output if you run MIGO transaction. for this you need to configure a output type and the need to do the config in NACE transaction code. this probebly do by the functional people.
if you still want to run this without the above once, then write a Exit over there to trigger this program, i mean write a User exit for the SAVE button, whenever the user press the SAVE button, trigger the user exit, under that exit, you need to write as 'SUBMIT PROGRAM <Program name and Return>'.

Using transaction OMBO to assign Form and Output program.

Code:
REPORT ZCS_GOODS.
*tables: mseg.
include zM07DRTOP.


data : begin of XEKPO occurs 0.
include structure EKPO .
data: end of XEKPO.

data : begin of xT157E occurs 0.
include structure T157E .
data: end of xT157E.

data : begin of xAM07M occurs 0.
include structure AM07M .
data: end of xAM07M.

data : begin of xMKPF occurs 0.
include structure MKPF .
data: end of xMKPF.

data : begin of xT159P occurs 0.
include structure T159P .
data: end of xT159P.

data : begin of xT001W occurs 0.
include structure T001W .
data: end of xT001W.

data : begin of xEKKO occurs 0.
include structure EKKO .
data: end of xEKKO.

data : begin of xT024 occurs 0.
include structure T024 .
data: end of xT024.

data: begin of xnast occurs 0.
include structure nast.
data: end of xnast.

data: fm_name type rs38l_fnam,
l_errtab type tsferror.

parameters: s_MBLNR like mseg-MBLNR.
PARAMETERS: p_form TYPE tdsfname OBLIGATORY DEFAULT 'ZCS_GOODSRECEIPT'.

select * from nast into TABLE xnast where kappl = 'ME' AND KSCHL = 'WE01'.

select * from mseg into table xmseg
WHERE MBLNR = S_MBLNR .


SELECT * FROM MKPF INTo TABLE xmkpf.

SELECT * FROM EKKO INTO TABLE XEKKO.

select * from ekpo into table xekpo.
loop at xmseg.
read table xmkpf with key mblnr = xmseg-mblnr.
read table xekko with key ebeln = xmseg-ebeln.
read table xekpo with key ebeln = xmseg-ebeln.
endloop.

* form entry_we01 USING ent_retco ent_screen.


call function 'SSF_FUNCTION_MODULE_NAME'
exporting formname = P_FORM
importing fm_name = fm_name
exceptions no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
* error handling
message id sy-msgid type sy-msgty number
sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3
sy-msgv4.
endif.
*
CALL FUNCTION FM_NAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
MSEG = XMSEG
EKPO = XEKPO
T157E = XT157E
AM07M = XAM07M
MKPF = XMKPF
T159P = XT159P
T001W = XT001W
EKKO = XEKKO
T024 = XT024
* 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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

* analyse internal error table of Smart Forms
call function 'SSF_READ_ERRORS'
importing
errortab = l_errtab.
if not l_errtab is initial.
* add your handling
endif.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Smartforms, SapScripts, PDF All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.