Submit program option
Dear Experts,
In the below code i'm getting all the pernr values from pb4000 table based on the selection criteria and using submit program rpapl005 i'm passing values to the pernr manually but i need to pass the values from internal tables automatically how to solve my issue is there any other way to solve this problem.
Thanks in Advance.
Thanks and Regards,
Thiru. R
*& Report ZREPORT_N
REPORT ZREPORT_N.
*& Report ZREPORT
tables : pb4000.
select-options s_date for pb4000-begda.
data : begin of wa,
pernr type pb4000-pernr,
begda type pb4000-begda,
apsta type pb4000-apsta,
end of wa,
it like table of wa.
select pernr
from pb4000 into table it where
begda in s_date AND APSTA eq '7'.
LOOP AT IT INTO WA.
WRITE : / WA-PERNR.
ENDLOOP.
SUBMIT RPAPL005
WITH PAPAPLNO-LOW EQ 40
WITH PAPAPLNO-LOW EQ 109
WITH PAPAPLNO-LOW EQ 408
WITH PAPAPLNO-LOW EQ 413
WITH PAPAPLNO-LOW EQ 1
WITH PAPAPSTA-LOW EQ 7
AND RETURN.
instead of passing values for PAPAPLNO-LOW manully i want to pass the values from internal table it.
Can any try to solve my issue.
Hi,
Use this:
data: rsparams_tab type table of rsparams.
rsparams_wa type rsparams.
Loop at it.
rsparams_wa-selname = 'PAPAPLNO'.
rsparams_wa-kind = 'S'.
rsparams_wa-sign = 'I'.
rsparams_wa-option = 'EQ'.
rsparams_wa-low = "I don't know which field from table IT you want to pass, so pick one you want
append rsparams_wa to rsparams_tab.
endloop.
SUBMIT RPAPL005 WITH SELECTION-TABLE rsparams_tab AND RETURN.
Hope it will help you
Marcin
Similar Messages
-
Hi all,
The following is the issue in submit program:
I am calling two programs /PBS/RIQMEL20 ( /pbs/iw59 ) and /PBS/RIAUFK20 ( /pbs/iw39 ) using submit programs in my z program.
I have created a layout /ZDEL56 for both programs. If I run submit program for /PBS/RIAUFK20 ( /pbs/iw39 ) I am getting the o/p in desired format ( As specified in the layout ).
How ever for program /PBS/RIQMEL20 ( /pbs/iw59 ) submit program is giving an error saying that layout is not found.
There is no difference b/w these two programs except that submitting program name is different.
The txn /pbs/iw59 when executed in background is giving the desired result. But when I try using submit program it is failing.
Can you please tell what mite be the problem?
Following is the sample piece of code.
submit /PBS/RIQMEL20
with pbs_apar EQ '1'
WITH VARIANT EQ '/ZDEL56'
Pointers will be highly appreciated.
Thanks,
Shiva.Hi,
In this case you need to use another internal table which is of type S_VBELN . Ex : it_vbeln.
In that you have to append the record
wa_vbeln-sign = 'I'
wa_vbeln-option = 'EQ'
wa_vbeln-low = w_inv.
append wa_vbeln to it_vbeln.
now use this
submit B VIA SELECTION-SCREEN
with P_DAYS = '4'
with P_KALSM = 'ZATCIN'
with S_VBELN = it_vbeln.
Now the new record will be appended with the values which are passing,. SO u wil have two rows in the S_VBELN.
Regards,
Venkatesh. -
Submit program B and return to program A selection screen
Dear all,
I have program A with selection screen and this program display listing.
In program A, when user choose the option to display another report listing in selection screen, then in program A, will have submit program B with ... and return
May I know how can make the program B after showing the listing go back to program A selection screen and not continue to display program A report listing?
Thanks
RgdsLike this
REPORT z_a.
PARAMETERS: pa_a(10) TYPE c,
pa_callb AS CHECKBOX.
IF pa_callb = 'X'.
SUBMIT z_b WITH pa_b = pa_a
AND RETURN.
EXIT.
ENDIF.
WRITE: / 'Here is program A, the parameter value is: ',pa_a .
REPORT Z_B.
PARAMETERS pa_b(10) type c.
write: / 'Here is program B, the parameter value passed from A is: ',pa_b .
Regards
Marcin -
I m having 2 programs separately.
in the first program i m calling the second program via submit .
If i use submit program & return means the control comes back to first program form second one .
But wat i need is i want to get values from the second program to first program through Internal table
Is this possible..
If yes maens can any one help me to solve this.
Thanks in advance.
Kalpanashri RajendranHi Kalpanashri,
You can use EXPORT and IMPORT statement.
Please check this sample code.
Program A :
SELECT-OPTIONS: S_BELNR FOR BKPF-BELNR.
EXPORT S_BELNR TO MEMORY ID 'ZXC9'.
Program B :
DATA: BEGIN OF S_BELNR OCCURS 10.
INCLUDE STRUCTURE STRUC1.
DATA: LOW LIKE BKPF-BELNR,
HIGH LIKE BKPF-BELNR.
DATA: END OF S_BELNR.
IMPORT S_BELNR FROM MEMORY ID 'ZXC9'.
For EXPORT: http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/export01.htm
For IMPORT: http://www.geocities.com/siliconvalley/campus/6345/import01.htm
Hope this will help.
Regards,
Ferry Lianto -
Problem with the selection screen in submit program
Hi Friends,
i am facing the problem wih the selection screen in submit program. in my Module pool program i am using the submit program statement, When i execute the program , The module program display the submit program selections creen.
I have implemented the code same as below.
submit ztest with tknum =p_tknum and return.
Can you pleaes help me how to avoid the submit program selection screen.
Thanks,
CharanHi Charan,
You have to give the selection screen values when you submit a job.
Press F1 on submit and you will see more details.
Here is an example from ABAP Documentation.
Program accessed
REPORT report1.
DATA text(10) TYPE c.
SELECTION-SCREEN BEGIN OF SCREEN 1100.
SELECT-OPTIONS: selcrit1 FOR text,
selcrit2 FOR text.
SELECTION-SCREEN END OF SCREEN 1100.
Calling program
REPORT report2.
DATA: text(10) TYPE c,
rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab,
range_tab LIKE RANGE OF text,
range_line LIKE LINE OF range_tab.
rspar_line-selname = 'SELCRIT1'.
rspar_line-kind = 'S'.
rspar_line-sign = 'I'.
rspar_line-option = 'EQ'.
rspar_line-low = 'ABAP'.
APPEND rspar_line TO rspar_tab.
range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'H'.
APPEND range_line TO range_tab.
range_line-sign = 'E'.
range_line-option = 'EQ'.
range_line-low = 'K'.
APPEND range_line TO range_tab.
SUBMIT report1 USING SELECTION-SCREEN '1100'
WITH SELECTION-TABLE rspar_tab
WITH selcrit2 BETWEEN 'H' AND 'K'
WITH selcrit2 IN range_tab
AND RETURN.
Regards,
Jovito. -
How to use Submit program of RAIMCOPY for a specific TCode - IM34
Hi Experts,
I have to use submit program RAIMCOPY. but the program intend used in differnt Tcodes (IM27,IM27_Close,IM27_REPEAT,IM34,IM44,IM54,IM64).
I used the following code but it is some other selection instead of IM34.
SUBMIT RAIMCOPY VIA SELECTION-SCREEN with PA_PRNAM = gv_improg
WITH PA_GJAHR = gv_appyear
with SO_VERSN-LOW = 'G00'
with P_XVOVR = 'X'
and RETURN.
Please help me to write a submit program RAIMCOPY for only IM34.
Regards,
Thulasiram.Yes at start of report (events LOAD-OF-PROGRAM and INITIALIZATION) the variant / parameters are not yet transfered to program, they are only passed just before the AT SELECTION-SCREEN OUTPUT, so that could have been nice ... before OSS note 927693 - Report variants used incorrectly in program RAIMCOPY which triggers now an error if sy-tcode <> pa_tcode in interactive mode ...
So either you look for an implicit enhancement option to force again pa_tcode to required value (e.g. stored in memory) and disable effect of the OSS note (*) /or/ you replace the SUBMIT statement with a CALL TRANSACTION with a small BDC data.
Regards,
Raymond
(*) SAP did that for transaction IMCAOV, 1023920 - IMCAOV: Unberechtigter Abbruch 00368 -
SWF Compilation Failed with "Submit All" Option
Hi,
I am using Captivate 6.1 and created a quiz with single choice questions. When I turn on the "Submit All" option, I can not preview/publish the file anymore. It says "SWF Compilation Failed." and I am advised to check if any user variables contain AS keywords. I am not using any user variables in this project. Whenever I turn the "Submit All" option off, preview/publish are possible again.
When publishing to HTML5, the error does not occur.
Can you please help me with this issue, since I would appreciate using the "Submit All" option.Hi
Check this forum : http://forums.adobe.com/thread/1111120?tstart=0
SWF compilation can come for following reasons:
1) If you use action script keywords in Captibvate project variables.
Resolution: Make sure you don't use action script keywords.
2) If you have invisible characters present in text fields.
Resolution: Don't Copy/Paste text from some other application to Captivate text fields like Project information etc. Type with key board. Create a blank project and publish, if you still get SWF compilation issue then your 64 bit JVM might be corrupted.
3) if your installation is 64 bit Captivate, 64 bit JVM might be corrupted.
Add Use32BitJVMForPublish = 1 in AdobeCaptivate.ini file
Close and Re-launch Captivate.
Re-publish the project
Captivate ini file is present at “C:\Program Files\Adobe\Adobe Captivate 6 x64” location
Thanks,
Vj -
Handle submit program for background jobs in RFC FM to send email in ITS
Hi all
I am facing a problem in ITS, i.e. I have called a RFC Function Module on the page load event of one of the HTML template. In that FM I have used <b>submit program</b>. This RFC FM is working fine in background i.e. it is sending pdf as email to a particular email address
but in the frontend it is not responding.
I wanted to ask whether we can handle submit <program-name> in background job from ITS
<b>If you are unable to understand the problem i can share with you my code as well.</b>
Thanks
Ekta TuliHi Tobias
The Function Module <b>ZV_FUNC_CCK_EMAIL_PDF</b> is used to generate the email with pdf as attachement. it is generating email at backend but not in frontend.
thanks
ekta
please find the code below for the FM
FUNCTION zv_func_cck_email_pdf.
*"*"Local interface:
*" IMPORTING
*" VALUE(CONTRACT) LIKE VBAP-VBELN
*" VALUE(EMAIL) LIKE ADR6-SMTP_ADDR
*" EXPORTING
*" VALUE(RETURN) TYPE CHAR4
data: i_vbak like vbak .
DATA: v_cont(10) TYPE c.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = contract
IMPORTING
output = v_cont.
DATA: z_element(30) TYPE c.
DATA: gv_fb_addr_get_selection LIKE addr1_sel.
DATA: BEGIN OF mtab_contract OCCURS 0, "sap field
ordno(10), "vbeln (10)
terr(6),
vkorg LIKE vbak-vkorg,
vkgrp LIKE knvv-vkgrp,
repname(35),
repmailbox(10),
gueen(10), "expires dated -same as valid to
kunnr(10),
name1(35), "name1(35)
stras(35), "stras(35)
pstlz(10), "pstlz(10)
ort01(35), "ort01(35) city
regio(3), "regio(3)
kunnr2(10),
name2(35), "NUM?(35)
stras2(35), "stras(35)
pstlz2(10), "pstlz(10)
ort012(35), "ort01(35) city
regio2(3), "regio(3)
kit1 LIKE vbap-matnr, " currently 41315
kit1-qty(6), " like vbap-zmeng,
kit2 LIKE vbap-matnr, " currently 41316
kit2-qty(6), " like vbap-zmeng,
kit3 LIKE vbap-matnr, " currently 41317
kit3-qty(6), " like vbap-zmeng,
kit4 LIKE vbap-matnr, " currently 91869US
kit4-qty(6), " like vbap-zmeng,
med1 LIKE vbap-matnr, " currently 7408cp
med1-qty(6), " like vbap-zmeng,
med2 LIKE vbap-matnr, " currently 0211CP
med2-qty(6), " like vbap-zmeng,
med3 LIKE vbap-matnr, " currently 0578CP
med3-qty(6), " like vbap-zmeng,
med4 LIKE vbap-matnr, " currently 0068CP
med4-qty(6), " like vbap-zmeng,
med5 LIKE vbap-matnr, " currently 0069CP
med5-qty(6), " like vbap-zmeng,
med6 LIKE vbap-matnr, " currently other
dis6 LIKE makt-maktx, " currently other
med6-qty(6), " like vbap-zmeng,
med7 LIKE vbap-matnr, " currently other
dis7 LIKE makt-maktx, " currently other
med7-qty(6), " like vbap-zmeng,
med8 LIKE vbap-matnr, " currently other
dis8 LIKE makt-maktx, " currently other
med8-qty(6), " like vbap-zmeng,
med9 LIKE vbap-matnr, " currently other
dis9 LIKE makt-maktx, " currently other
med9-qty(6), " like vbap-zmeng,
med10 LIKE vbap-matnr, " currently other
dis10 LIKE makt-maktx, " currently other
med10-qty(6), " like vbap-zmeng,
END OF mtab_contract.
DATA: BEGIN OF mtab_material OCCURS 0,
ordno(10),
matnr LIKE vbap-matnr,
qty LIKE vbap-zmeng,
END OF mtab_material.
DATA: w-mm(4) VALUE ' MM '.
*SELECT-OPTIONS: s_vkorg FOR vbak-vkorg,
* s_vkgrp FOR knvv-vkgrp, "Sales Group
* s_terr FOR knvp-kunn2. "Territory Code
*PARAMETERS: p_parvw LIKE vbpa-parvw MEMORY ID par OBLIGATORY, "Partner ID
** DEFAULT 'Z1'.
* p_vbeln LIKE vbak-vbeln MEMORY ID aun,
* p_email LIKE adr6-smtp_addr MEMORY ID email. "Sales Document #
*SELECT-OPTIONS: "s_vbeln FOR vbak-vbeln MEMORY ID aun, "Sales Document #
* s_guebg FOR vbak-guebg, "Valid-From Date
* s_gueen FOR vbak-gueen, "Valid-To Date
* s_ship FOR vbpa-kunnr, "Ship-to customer
* s_bstzd FOR vbak-bstzd MEMORY ID bst ."DEFAULT 'CCK'. "P.O. # Supplement
DATA: i_otf TYPE STANDARD TABLE OF itcoo,
i_content_txt TYPE table of solisti1, "Content
i_content_bin TYPE solix_tab, "Content
i_content_bin1 TYPE solix_tab, "Content
i_objhead TYPE soli_tab,
w_pdf TYPE solisti1, "For PDF
w_res TYPE itcpp, "SAPscript output
w_otf TYPE itcoo, "For OTF
w_transfer_bin TYPE sx_boolean, "Content
prog(60).
data : t_obj_bin type standard table of solisti1.
DATA: w_arc_params LIKE arc_params,
w_pri_params LIKE pri_params.
*DATA: lcl_cls TYPE REF TO cl_gui_frontend_services.
CONSTANTS : c_x TYPE c VALUE 'X', "X
c_locl(4) TYPE c VALUE 'LOCL', "Local Printer
c_otf TYPE sx_format VALUE 'OTF', "OTF
c_pdf TYPE sx_format VALUE 'PDF', "PDF
c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER
c_bin TYPE char10 VALUE 'BIN'. "BIN
DATA: v_name TYPE string ."Downloading File Name
DATA: v_len_in TYPE so_obj_len,
v_tempdir(50) TYPE c,
v_size TYPE i.
DATA : x_pdf_bag_tline TYPE rcl_bag_tline,
v_pdf_fsize TYPE i,
objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE,
doc_chng LIKE sodocchgi1,
tab_lines LIKE sy-tabix.
DATA : v_pnum LIKE usr21-persnumber,
v_anum LIKE usr21-addrnumber,
smtp_addr LIKE adr6-smtp_addr.
DATA: v_path TYPE string,
v_code TYPE i.
DATA : wa_obj_txt TYPE solisti1.
DATA : t_obj_txt TYPE STANDARD TABLE OF solisti1.
DATA : t_rec_list TYPE STANDARD TABLE OF somlreci1.
DATA : t_obj_pack TYPE STANDARD TABLE OF sopcklsti1.
DATA : wa_document_data TYPE sodocchgi1. "Mail data
DATA : wa_rec_list TYPE somlreci1.
DATA: reciever TYPE sadrud. "Email address of the receiver
DATA : wa_obj_pack TYPE sopcklsti1.
DATA: v_lines(10) TYPE n.
DATA: binfilesize TYPE i.
DATA : wa_obj_header TYPE solisti1.
DATA : t_obj_header TYPE STANDARD TABLE OF solisti1.
DATA : obj_id TYPE sofolenti1-object_id. "To send a file as attatchment
data: pdftab type table of tline with header line.
data : flag_sent_to_all type sonv-flag.
*START-OF-SELECTION.
* IF lcl_cls IS INITIAL.
* CREATE OBJECT lcl_cls.
* ENDIF.
CLEAR i_vbak.
SELECT * FROM vbak into i_vbak
WHERE
* guebg IN s_guebg AND "Valid-From Date
* gueen IN s_gueen AND "Valid-To Date
* vkorg IN s_vkorg AND
vbeln = v_cont AND
* AUART = 'LP ' AND "Converts to 'CO ' Scheduling A
auart = 'KM ' AND "Converts to 'CQ ' Qty contract
* VBTYP = 'E' AND "sales doc cat? JM
vbtyp = 'G' ."AND "sales doc cat "JM
* bstzd IN s_bstzd.
mtab_contract-kunnr = i_vbak-kunnr.
mtab_contract-ordno = i_vbak-vbeln.
mtab_contract-vkorg = i_vbak-vkorg.
WRITE i_vbak-gueen TO mtab_contract-gueen. "CHG014419
APPEND mtab_contract.
ENDSELECT.
LOOP AT mtab_contract.
* PERFORM get_contract. "CO sales orders line items
******Get Contract*********
* SELECT SINGLE kunnr "partner
* INTO vbpa-kunnr
* FROM vbpa
* WHERE vbeln EQ mtab_contract-ordno
* AND posnr EQ '000000'
* AND parvw EQ 'WE' "Ship-To's
* AND kunnr IN s_ship. "Ship-To ID added 04/01/99
* IF sy-subrc EQ 0 .
* MOVE vbpa-kunnr TO mtab_contract-kunnr2.
* MODIFY mtab_contract.
* ELSE.
* EXIT.
* ENDIF.
CLEAR knvp.
SELECT SINGLE kunn2 "territory
INTO knvp-kunn2
FROM knvp
WHERE kunnr EQ mtab_contract-kunnr2
AND vkorg EQ mtab_contract-vkorg
AND parvw EQ 'Z6'.
* AND kunn2 IN s_terr .
IF sy-subrc EQ 0 .
MOVE knvp-kunn2 TO mtab_contract-terr.
MODIFY mtab_contract.
ELSE.
EXIT.
ENDIF.
CLEAR kna1. "get rep name and mail box
SELECT SINGLE name2 FROM kna1 INTO (kna1-name2)
WHERE kunnr = knvp-kunn2.
IF sy-subrc EQ 0 .
SPLIT kna1-name2 AT w-mm INTO mtab_contract-repname
mtab_contract-repmailbox.
mtab_contract-repmailbox+3 = mtab_contract-repmailbox.
mtab_contract-repmailbox(3) = 'MM'.
MODIFY mtab_contract.
ENDIF.
CLEAR knvv.
SELECT SINGLE vkgrp
INTO knvv-vkgrp
FROM knvv
WHERE kunnr EQ knvp-kunn2
AND vkorg EQ mtab_contract-vkorg.
* AND vkgrp IN s_vkgrp.
IF sy-subrc EQ 0 .
MOVE knvv-vkgrp TO mtab_contract-vkgrp.
MODIFY mtab_contract.
ELSE.
EXIT.
ENDIF.
mtab_contract-med1-qty = '_______'.
mtab_contract-med2-qty = '_______'.
mtab_contract-med3-qty = '_______'.
mtab_contract-med4-qty = '_______'.
mtab_contract-med5-qty = '_______'.
mtab_contract-med6-qty = '_______'.
mtab_contract-med7-qty = '_______'.
mtab_contract-med8-qty = '_______'.
mtab_contract-med9-qty = '_______'.
mtab_contract-med10-qty = '_______'. "JM
mtab_contract-kit1-qty = '____'.
mtab_contract-kit2-qty = '____'.
mtab_contract-kit3-qty = '____'.
mtab_contract-kit4-qty = '____'.
mtab_contract-dis6 = 'OTHER _____________________'. "JM
mtab_contract-dis7 = 'OTHER _____________________'. "JM
mtab_contract-dis8 = 'OTHER _____________________'. "JM
mtab_contract-dis9 = 'OTHER _____________________'. "JM
mtab_contract-dis10 = 'OTHER _____________________'. "JM
* SELECT * FROM VBAP WHERE VBELN = MTAB_CONTRACT-ORDNO.
* IF VBAP-MATNR = '7408CP'.
* MTAB_CONTRACT-MED1 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '0211CP'.
* MTAB_CONTRACT-MED2 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '91865US'.
* MTAB_CONTRACT-MED3 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '0578CP'.
* MTAB_CONTRACT-MED4 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '0068CP'.
* MTAB_CONTRACT-MED5 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '0069CP'.
* MTAB_CONTRACT-MED6 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '92055CP'. "JM
* MTAB_CONTRACT-MED7 = VBAP-MATNR. "JM
* ELSEIF VBAP-MATNR = '90799CP'. "JM
* MTAB_CONTRACT-MED8 = VBAP-MATNR. "JM
* ELSEIF VBAP-MATNR = '41315'.
* MTAB_CONTRACT-KIT1 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '41316'.
* MTAB_CONTRACT-KIT2 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '41317'.
* MTAB_CONTRACT-KIT3 = VBAP-MATNR.
* ELSEIF VBAP-MATNR = '91869US'.
* MTAB_CONTRACT-KIT4 = VBAP-MATNR.
* ELSE.
* SELECT SINGLE MAKTX INTO MAKT-MAKTX
* FROM MAKT WHERE MATNR = VBAP-MATNR.
* ENDIF.
* MODIFY MTAB_CONTRACT.
* ENDSELECT.
MODIFY mtab_contract.
* IF.
** mtab_contract-terr IN s_terr AND
** mtab_contract-kunnr2 IN s_ship AND
** mtab_contract-vkgrp IN s_vkgrp.
** PERFORM get_address.
* ELSE.
* DELETE mtab_contract INDEX sy-tabix.
* ENDIF.
ENDLOOP.
SORT mtab_contract BY terr.
* PERFORM set_print_option.
* Print defaults should be immed and delete after print...
itcpo-tdimmed = ' '.
itcpo-tddelete = 'X'.
itcpo-tdnewid = 'X'.
itcpo-tdcopies = 1.
itcpo-tdnoprev = 'X'.
itcpo-tdgetotf = 'X'.
itcpo-tddest = 'LOCL'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LOCL'
no_dialog = 'X'
IMPORTING
out_archive_parameters = w_arc_params
out_parameters = w_pri_params.
*exit if cancel chosen*
IF sy-subrc NE 0.
EXIT.
ENDIF.
sadr-regio = 'CA'.
sadr-pstlz = '92620'.
LOOP AT mtab_contract.
* PERFORM check-for-values.
IF mtab_contract-ordno = space.
mtab_contract-ordno = '___________'.
ENDIF.
IF mtab_contract-terr = space.
mtab_contract-terr = '______'.
ENDIF.
IF mtab_contract-repname = space.
mtab_contract-repname = '___________________________________'.
ENDIF.
IF mtab_contract-repmailbox = space.
mtab_contract-repmailbox = '__________'.
ENDIF.
IF mtab_contract-kunnr = space.
mtab_contract-kunnr = '__________'.
ENDIF.
IF mtab_contract-name1 = space.
mtab_contract-name1 = '___________________________________'.
ENDIF.
IF mtab_contract-stras = space.
mtab_contract-stras = '___________________________________'.
ENDIF.
IF mtab_contract-pstlz = space.
mtab_contract-pstlz = '__________'.
ENDIF.
IF mtab_contract-ort01 = space.
mtab_contract-ort01 = '___________________________________'.
ENDIF.
IF mtab_contract-regio = space.
mtab_contract-regio = '___'.
ENDIF.
IF mtab_contract-kunnr2 = space.
mtab_contract-kunnr2 = '__________'.
ENDIF.
IF mtab_contract-name2 = space.
mtab_contract-name2 = '___________________________________'.
ENDIF.
IF mtab_contract-stras2 = space.
mtab_contract-stras2 = '___________________________________'.
ENDIF.
IF mtab_contract-pstlz2 = space.
mtab_contract-pstlz2 = '__________'.
ENDIF.
IF mtab_contract-ort012 = space.
mtab_contract-ort012 = '___________________________________'.
ENDIF.
IF mtab_contract-regio2 = space.
mtab_contract-regio2 = '___'.
ENDIF.
* PERFORM open_form.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
dialog = ' '
form = 'ZREV_CCK_AGREMT'
language = sy-langu
OPTIONS = itcpo
EXCEPTIONS
canceled = 1
device = 2
form = 3
OPTIONS = 4
unclosed = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE e000(zz) WITH 'Open Form Error. ' sy-subrc.
ENDIF.
z_element = 'MAIN'.
* PERFORM write_form.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = z_element
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
OTHERS = 7.
* PERFORM close_form.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = w_res
TABLES
otfdata = i_otf
EXCEPTIONS
unopened = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000(zz) WITH 'Close Form Error. ' sy-subrc.
ENDIF.
*&---Convert OTF data to PDF data.
call function 'CONVERT_OTF'
exporting
format = 'PDF'
importing
bin_filesize = binfilesize
tables
otf = i_otf
lines = pdftab[].
data : name LIKE RLGRAP-FILENAME.
CONCATENATE 'C:Temp' mtab_contract-ordno '.pdf' INTO v_name.
*CALL FUNCTION 'DOWNLOAD'
* EXPORTING
* bin_filesize = v_size
* filename = name
* filetype = 'BIN'
* TABLES
* data_tab = pdftab[].
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = v_name
FILETYPE = 'BIN'
tables
data_tab = pdftab[].
* Downloading the PDF File
* CALL METHOD lcl_cls->gui_download
* EXPORTING
* bin_filesize = v_size
* filename = v_name
* filetype = c_bin
* CHANGING
* data_tab = pdftab[].
CALL METHOD cl_gui_cfw=>flush.
**Send PDF as Email.
* wa_obj_txt-line = 'CCK Contract Agreement'.
APPEND wa_obj_txt TO t_obj_txt.
CLEAR wa_obj_txt.
wa_obj_txt-line = 'Please find attatched PDF document for Contract'.
APPEND wa_obj_txt TO t_obj_txt.
CLEAR wa_obj_txt.
DESCRIBE TABLE t_obj_txt LINES tab_lines.
**Prepare document data
wa_document_data-obj_name = 'CCK Contract Agreement'.
wa_document_data-obj_descr = 'CCK Contract Agreement'.
wa_document_data-obj_langu = sy-langu.
wa_document_data-proc_type = 'R'.
wa_document_data-proc_name = 'CCK'.
wa_document_data-priority = c_x.
wa_document_data-obj_prio = c_x.
**Receiving list
wa_rec_list-receiver = sy-uname.
wa_rec_list-rec_type = 'B'.
wa_rec_list-com_type = 'INT'.
wa_rec_list-notif_del = c_x.
APPEND wa_rec_list TO t_rec_list.
CLEAR wa_rec_list.
wa_rec_list-receiver = '[email protected]'."p_email.
reciever = wa_rec_list-receiver.
wa_rec_list-rec_type = 'U'.
wa_rec_list-com_type = 'INT'.
wa_rec_list-notif_del = c_x.
APPEND wa_rec_list TO t_rec_list.
CLEAR wa_rec_list.
*Object packet
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
TABLES
content_in = pdftab[]
content_out = t_obj_bin
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4
IF sy-subrc <> 0.
ENDIF.
DESCRIBE TABLE t_obj_bin LINES v_lines.
CLEAR wa_obj_pack-transf_bin .
wa_obj_pack-head_start = 1.
wa_obj_pack-head_num = 0.
wa_obj_pack-body_start = 1.
wa_obj_pack-body_num = tab_lines.
wa_obj_pack-doc_type = 'RAW'.
wa_obj_pack-doc_size = tab_lines * 255.
APPEND wa_obj_pack TO t_obj_pack.
CLEAR wa_obj_pack.
wa_obj_pack-transf_bin = 'X'.
wa_obj_pack-head_start = 1.
wa_obj_pack-head_num = 0.
wa_obj_pack-body_start = 1.
wa_obj_pack-body_num = v_lines.
wa_obj_pack-doc_type = 'PDF'.
wa_obj_pack-obj_name = 'ATTATCHMENT'.
wa_obj_pack-obj_descr = mtab_contract-ordno.
wa_obj_pack-doc_size = binfilesize.
APPEND wa_obj_pack TO t_obj_pack .
CLEAR wa_obj_pack.
**Object header
wa_obj_header-line = 'PDF'.
APPEND wa_obj_header TO t_obj_header.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_document_data
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = flag_sent_to_all
new_object_id = obj_id
TABLES
packing_list = t_obj_pack
object_header = t_obj_header
contents_bin = t_obj_bin
contents_txt = t_obj_txt
receivers = t_rec_list
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
else.
return = 'true'.
ENDIF.
ENDFUNCTION.
<b> Flow Editor</b>
<flow>
<state name="Start">
<module name="<b>ZV_FUNC_CCK_EMAIL_PDF</b>" type="RFC" stateful="1">
<inputmapping source="Contract" target="CONTRACT"/>
<inputmapping source="email" target="EMAIL"/>
</module>
<module name="ZV_FUNC_CCK_VALIDATE_SHIPTO" type="RFC" stateful="1">
<inputmapping source="SHIP_TO" target="KUNNR"/>
<inputmapping source="USERNAME" target="USER"/>
<outputmapping source="CITY" target="CITY"/>
<outputmapping source="NAME" target="NAME"/>
<outputmapping source="POSTAL" target="POSTAL"/>
<outputmapping source="REGION" target="REGION"/>
<outputmapping source="RETURN" target="RETURN"/>
<outputmapping source="SD_CITY" target="SD_CITY"/>
<outputmapping source="SD_NAME" target="SD_NAME"/>
<outputmapping source="SD_POSTAL" target="SD_POSTAL"/>
<outputmapping source="SD_REGION" target="SD_REGION"/>
<outputmapping source="SD_STREET" target="SD_STREET"/>
<outputmapping source="SOLDTO" target="SOLDTO"/>
<outputmapping source="STREET" target="STREET"/>
</module>
</state>
<event name="onLoad" next_state="Start"/>
<event name="Check2" next_template="ZV_CCO_CONFIRMED_ORDER"/>
</flow> -
SUBMIT program VIA JOB and SET/GET parameter
Hi All
I need to pass the content of a variable from the program 'A' to program 'B'.
Program A uses JOB_OPEN , SUBMIT program VIA JOB jobname NUMBER jobnumber AND return, JOB_CLOSE.
I tried to use import/export memory but it didn't work. Then I am trying to use set/get parameters but it also did not work.
Program A is going to run in any server and program B will run in the central instance (it is determined in the FM JOB_CLOSE, parameter target_server).
Program does not have selection-screen.
Is it possible use set/get parameter with submit via job?
Could you please advise?
Thanks in advance.
João GaiaHere a simple code
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
'TRANSFER DATA'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1 value 'X'.
* Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
* Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
* Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
" event_id = starttime-eventid
" event_param = starttime-eventparm
" event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
" laststrtdt = starttime-laststrtdt
" laststrttm = starttime-laststrttm
" prddays = 1
" prdhours = 0
" prdmins = 0
" prdmonths = 0
" prdweeks = 0
" sdlstrtdt = starttime-sdlstrtdt
" sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
" targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Then... for import/export of a variable, you can use Import Memory and Export Memory function.
Like this:
REPORT A:
IF NOT it_dlist_out IS INITIAL.
EXPORT it_dlist_out TO MEMORY ID 'TEST1234'.
ELSE.
* Clearing memory
FREE MEMORY ID 'TEST1234'.
ENDIF.
REPORT B:
IMPORT it_dlist_out TO lt_dlist_out FROM MEMORY ID 'TEST1234'.
Edited by: spantaleoni on Jan 11, 2011 3:21 PM
Edited by: spantaleoni on Jan 11, 2011 3:23 PM -
Using SUBMIT program command in Background
Hi,
I am submitting the program in Background using Submit<program> command.
Job is getting released but not fininishing(not executing the program) in ECC6.0.
Same program is working in fine in 4.5b.
Please let me know if any one faces this situation. Its very urgent.
Expecting the reply from you soon..
Thanks
Regards,
Raj AHi,
perhaps you or your admin have configured to less batch-workprocess or they are all configured only for A-class jobs.
Try to start the job as A-Class job. If the program is executed, then ask your administrator to configure more batch workprocess that are not reserved for A-class jobs.
Regards,
Stefan -
How to get variant of SUBMIT program to the main program.
Hi!
In my ZFRFI00R_PRINT_DOCUMENTS program i am using
SUBMIT zfrfi01r_alv_fi_document
using SELECTION-SET sp_vari
with p_comp = gw_bkpf_key-bukrs
with p_year = gw_bkpf_key-gjahr
with p_doc = gw_bkpf_key-belnr
and return.
So in the main program i created one layout field to get the what are all the layouts in the SUBMIT program.
I am using FMs 'REUSE_ALV_VARIANT_DEFAULT_GET' , 'REUSE_ALV_VARIANT_F4' to get default layout from the SUBMIT program.
It is not showing the layouts which are in the SUBMIT program when i press F4 in the layouy input field in the selection screen of the main program.
Can anyone help in this regard?
Thank you in advance for ur help.
Regards,
RajHi,
IN the disvariant parameter are you populating the correct program name..meaning the submitted program name..
Thanks,
Naren -
Command 'SUBMIT program ' program is hardcoded
Hi All,
Any idea if we can use ABAP command (SUBMIT <program> with Variant) <program> as variable instead of hardcoding program name?
I tried But I found only in command 'SUBMIT program ' program is hardcoded i.e. can not be variable.
Can any one please guide if we can use program name as variable in SUBMIT ABAP statement?
submit ZTEST2 and return
using selection-set 'TESTV'
user SY-UNAME
via job JOBNAME
number JOBCOUNT.
regardsHello,
Please use
submit (lh_prog) and return
using selection-set 'TESTV'
user SY-UNAME
via job JOBNAME
number JOBCOUNT.
where lh_prog is a variable type chracter... -
Call Transaction / Submit Program
Hello All,
I have two ABAP reports : Report A & Report B.
Report A has selection screen similar to Report B, where report A needs to send data to selection screen of Report B.
Report B should be processed displaying its list display & should return its control back to Report B.
This can be easily achieved by using SUBMIT program(Report B) with values from Report A.
But my report B is made to run only via a TCode(ZEXECUTE) & hence when i submit program it is not executed
as sy-tcode value in such case comes as SE38 .
Further , Call Transaction (ZEXECUTE) using bdc_tab helps in passing the TCode & respective selection screen values
correctly to Report B , but i am not able to see the outputs of the same.
Please Note : I am not authorized to do any changes in Report B , so whatever i can try is from Report A itself.
Kindly Help,
SudeepHI Suhas ,
Firstly thanks for replying.
1) Do you mean there is a hardcoding in Report B to check the t-code?
Yes.
2) What is the display mode you're using when doing via CALL TRANSACTION?
Currently i am passing it as "A" , but still not able to get any output.
Report A provides report B all the required values along with 'BDC_OKCODE' '=ONLI'
for executing the same. The report gets processed , but i am not able to see any list display.
Thanks,
Sudeep -
I used the drawing option in AppleWorks. What is an equivalent program/option in Lion? I use it to design quilts.
Nothing that comes with Lion.
Just put, "osx drawing program free," in Google and take your pick.
First one on the list is one called Paintbrush: http://paintbrush.sourceforge.net/
You could also just search the App Store. -
Hi All,
I am getting a Run time error in case of data issue while using Submit Program RHGRENZ0(to delimit the objects ) in production server.
I would like to use TRY/ENDTRY and use catch cx_root exception.
Will that Catch the Data issue in future.
I could not reproduce similar scenario in development.
Can Anyone suggest me.
Thank you
Edited by: Kumar B on Oct 20, 2009 7:44 PMHi ,
I am still getting Run time error even if I use TRY/ENDTRY block.
Now I could create the error scenario.
Actually I use Submit Program RHGRENZ0 in my custom program to delimit the positions.
Now i have a position say '10000000'
10/09/2009 12/31/9999 A 008 Holder P 00032411 ???
10/07/2009 10/15/2009 A 008 Holder P 00053245 TEST EMP
It has 2 holders .But the Employee 32411 No more exist.
In that case I get the Error message
"10/21/2009 20:12:11 Personnel number 00032411 does not exist 5A 054 E"
Thus the Job fails.
I just want to continue the job with other records instead of job failing for sake of one record.
Is there any chance that Submit Program errors can be diverted rather than giving the Error out.
Note : Here I am giving you a scenario.In actual this case might not occur,As we are checking of any A008 relation exists beyond delimtation date and eliminating such scenario.So My actual need is to avoid run time error in case of this kind of scenarios
Edited by: Kumar B on Oct 21, 2009 2:30 PM
Maybe you are looking for
-
Clear the content of Checkbox without looping for every record
Hi all, I am Karthik. I am working in Oracle EBS. I am developing one form in which it contain 2 checkbox. if checkbox1 is selected in 1st record it need to check checkbox2 all the record till the end of the block. when i uncheck it need to do revers
-
How to pair my iPad with my iPhone
How do I pair my iPad with my iphone
-
I bought a movie a while ago and now it doesn't play
I bought a movie of the itunes store. I played it a couple time then when i try to play it and it brought up an error messege like, "original file not found" now its just plain out not there. Itunes store is going to make me buy a new one if i want t
-
ITunes sign in "Unknown Error" on my Mac only.
I get the "Unknown Error" in iTunes only. My password works on all other devices. Then when I try to sign in iTunes more than 3 times, I end up having to reset password again. This is only a problem with iTunes on my Mac, not iphone or ipad.
-
My phone is still disabled with three attempts of using your advice to connect with computer, the following message keeps popping up with numbers 3194. What do I do next to disable my phone?