Problem in submiting standard program via job
Hi Experts ,
I have developed programs for creating and posting return lots and payment lots for multiple incoming files. For this i have submited standard program of FPB3 and FPB5 transaction . What happened is , if the child program fails due to some reason for one file , it is not coming back to the mother program and as a result other files remain unprocessed . So for this i tried with submiting the child program Via job so that if child program fails , only that job will fail and the mother program will not fail , so rest files will be processed .
But the problem is the child program (standard program of FPB3/FPB5 ) is not working by this i.e. the lots are not getting created adn.
Awaiting for any respone .
Hi,
If you are using Submit via Job, you need to use JOB_OPEN and JOB_CLOSE FM's.
JOB_OPEN : Create a new job and return you the job number which you use in Submit
JOB_CLOSE: Will set the release conditions of the job.
Example:
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
Regards,
Jovito
Similar Messages
-
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 -
Import internal table in submit program via job
Hi,
I'm submitting in a backgroudn job a program wich does a CALL TRANSACTION, this program submited reads ITBDC table importing table from memory ID 'itbdc' but this is empty, why in background job processing it can´t read data from memory because It seems it reads from another place or it's not reading anything!
Thanks!!REPORT report2.
DATA: text TYPE c LENGTH 10,
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. -
Strange problem when copying standard program SAPF100 (transaction F.05)
Hi there ABAP'ers,
I've got a very strange problem I can't figure out :/
I'm doing a copy of a standard program - SAPF100, which stands for F.05 transaction.
I copy it to ZSAPF100 and after launching it, filling a selection-screen with data and F8 I'm receiving a dump
GETWA_NOT_ASSIGNED
Field symbol has not yet been assigned.
The termination occurred in the ABAP program "SAPF100" in "DO_SKC1C".
The main program was "ZSAPF100 ".
The termination occurred in line 253 of the source code of the (Include)
program "SAPF100_SBEW"
of the source code of program "SAPF100_SBEW" (when calling the editor 2530).
and when debugging the place in Zcode where error occurs - really a fs is not assigned, whilst in standard code is assigned.
Why such situation appeared? I just copied the standard program and launched a copy :/ How to deal with that problem?
I will be very very very thankful for a help.
Regards. P.I'm doing the copy:
Components:
Source
Text elements
Documentation
Variants
User interface
Screens
INCLUDEs
Includes:
FROM -> TO
<ICON> Z<ICON>
<LINE> Z<LINE>
FIUUMS40 ZFIUUMS40
RKASMAWF ZRKASMAWF
SAPF100_I1 ZSAPF100_I1
SAPF100_POSTINGS ZSAPF100_POSTINGS
SAPF100_SBEW ZSAPF100_SBEW
SAPF100_SLDATA ZSAPF100_SLDATA
SCHEDMAN_EVENTS ZSCHEDMAN_EVENTS
And still DUMP -
Problem while copying standard program to Z Program
Hi SAP Forum,
I have copied one standard program to Zprg. and there are TWO Screens in standard program (100, 200). But in my Zprg only 200 copied, when I'm trying to copy Screen 100, it shows an error, "Screen already exists"..
And also, I've created one "Z" Transaction Code for my same program. In that, I've mention, Screen Number: 100.. When I execute "Z" Transaction, the Screen 100, will come as selection cretria is on that, and when I click on Execute Button, it comes back in SAP EASY ACCESS Screen (Initial Screen). But I want that, Screen 200 will come when I click on execute Button in Screen 100.
How can I resolve this?
Thanks
DevinderHi ags,
Thanks.. I've already changed the TCODE from code and second thing about Include, I've also changed the name of BOTH (two Includes) and it is working fine.. but error still coming...
Generation errors in program
Source code ???????????????????????????????????????? Line 0
Error when generating the selection screen "0100" of report "ZRVBBWULS
and also, I've done only one change in Include, I've added one select-options over there and getting the same error, but if I add PARAMETERS, then its executed successfully. But I want add a "Posting Date" as SELECT-OPTIONS.
Pls try to resolve this..
Thanks a lot in advance
Devinder
Edited by: Devinder Pawha on May 13, 2010 2:02 PM -
Regarding HR_INFOTYPE_OPERATION fm submiting VIA JOB
Hello Experts,
I am submitting a program VIA job, in side my submit program i m using this FM HR_INFOTYPE_OPERATION, but this function module not updating any values.
when i goto the job and tryed debug the job that time the values are updating.
is this FM will work only in fore ground.
and also we i have passed the dialog_mode parameter as "1" also.
any inputs...
Thanks,
Sureshsee this:
tables: pa0105.
infotypes: 0105.
DATA : I_RETURN TYPE BAPIRETURN1,
I_KEY TYPE BAPIPAKEY,
PERNR TYPE P0001-PERNR,
I_P0105 TYPE TABLE OF P0105 WITH HEADER LINE,
ENDDA TYPE P0105-ENDDA,
BEGDA TYPE P0105-BEGDA.
MOVE '00000010' TO PERNR.
BEGDA = SY-DATUM + 1.
ENDDA = SY-DATUM + 1.
i_p0105-pernr = PERNR.
i_p0105-infty = '0105'.
i_p0105-subty = '0002'.
i_p0105-endda = ENDDA.
i_p0105-begda = BEGDA.
I_P0105-USRTY = '0002'.
I_P0105-USRID = id.
APPEND i_p0105.
CALL FUNCTION 'DEQUEUE_ALL' .
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = PERNR.
IF SY-SUBRC = 0.
WRITE 'Employee Locked Successfully'.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0105'
NUMBER = PERNR
SUBTYPE = '0002'
VALIDITYEND = BEGDA
VALIDITYBEGIN = ENDDA
RECORD = i_p0105
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT = 'X'
IMPORTING
RETURN = I_RETURN
KEY = I_KEY.
IF SY-SUBRC = 0.
WRITE : 'FM returns sy-subrc 0'.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'.
Edited by: pratyush v on Feb 19, 2009 11:31 AM
Edited by: pratyush v on Feb 19, 2009 11:31 AM -
Problem submitting RFEBKA00 via Job
Hi experts
I have a requirement to create a Z program to upload 3 different files by using RFEBKA00.
For this purpouse, I have created a Z program which creates 3 Z jobs (ZA, ZB, ZC one per file) using JOB_OPEN / SUBMIT program VIA JOB / JOB_CLOSE.
Once every job is finished, I need to read logs using BP_JOBLOG_READ,and if there are no errors, move files to other folder.
My questions are:
1.- When using JOB_OPEN and SUBMIT VIA JOB name NUMBER n, as far as I know n is the number returned by jobcount parameter from JOB_OPEN and should be the same for both jobs (the Zjob created by JOB_OPEN and the one created by program RFEBKA00).When I debbug the program, it is OK, but when accessing table TBTCO sometimes there are 2 different jobcounts. Seems that jobcount is created based on sy-uzeit and sometimes there is some delay between JOB_OPEN and SUBMIT. Is there any way to ensure both jobs have the same jobcount?.
2.- As I need to read the log for each file, and because of the fact that the job created by submitting RFEBKA00 has always the same name, if the answer to my first question is NO, how can I link each of my Z jobs with its corresponding RFEBKA00 job?.
Many thanks in advance for your answers.
BR,
Carlos.Hi Thomas
Thanks for your answer.
For your first question, there is not BD key problem beacuse of my job is ZJOB and the one created when doing submit via job is RFEBKA00-EXTR.CTA.EL. (standard job) have different names.
But job number should be the same, because I'm using JOB_OPEN (which return the job number in parameter jobcount) and SUBMIT VIA JOB .
For the second question, and based on SAP documentation about SUBMIT , when submitting a program vía job, the submitted program is executed as a background task, which means creating a new job, so the answers is yes, the standard program schedules a new job. -
Suppress Information message during submit a standard program
Hi experts,
I am calling standard program RCATSCO from a report using following code:
SUBMIT rcatstco WITH p_pernr IN s_pernr
WITH p_date IN lt_r_date
WITH p_belnr IN s_belnr
WITH s_rkdauf IN s_rkdauf
WITH p_budat EQ sy-datum
WITH p_warn EQ gc_x
EXPORTING LIST TO MEMORY
AND RETURN.
When all data are already transferred to controlling this standard program displays a popup information message 'No data for transfer'. I need to suppress this popup and continue execution of the report. Please help.
Thanks,
ArnabOne option is to do that check yourself and bypass submitting the program if there is no data to transfer. Another option is to submit the program via job. That way the the message will go to the job log. I see that you are using the option exporting list to memory, which means you want to read the spool after the program is executed. With the "via job" option, you may need to monitor the status of the job for completion and then read its spool.
-
STANDARD PROGRAM FOR SMARTFORMS
hi all,
i have problem in finding standard program for <u>std. PO Smartforms</u> i.e /SMB40/MMPO_A (purchase order).
i have checked in table TNAPR. i dint find. can anyone help finding the std. program name.
regards,
thanks in advance.Hi,
Yes, there is standard smartform for PO (pre-configured forms) but you have to import package :/SMB40
PO Form: /SMB40/MMPO_L
Print Program: /SMB40/FM06P
See the note 595812: it explain how to download the preconfigured smartforms.
Anyway this is an extract of that note:
Detailed information can be accessed at the site:
http://service.sap.com/preconfiguredforms OR
http://service.sap.com/smb/development/preconfiguredforms.
To download preconfigured smartform package, please:
1. Go to http://service.sap.com/installations, select tab "download".
2. On the right hand side screen, locate navigation tree node
SAP Software Distribution Center->Download->Installations and Upgrades->
Entry by Application Group.
3. In the main window (right hand side), follow the path
SAP Best Practices->Best Practices for mySAP All-in-One-> PRECONFIGURED
SMART FORMS, you can find available preconfigured smartform versions.
Here you can also download the PO smartform.
Hope this will help.
Regards,
Ferry Lianto -
Problem in Standard program while selecting Index
Hi,
I am using the Standard SAP Program ' RFKKZE00' for creating Payment-Lot in my Custom Program ( Z-program ).
The Std. Program inturn calls 'RFKKZE01' and which inturn calls 'RFKKZE02' via Background Job.
The problem is that the program 'RFKKZE02' fails in a Select Query ( so its not clearing documents in the Payment-Lot )
( SELECT * FROM DFKKOP WHERE ABWBL EQ PAR_OPBEL
AND ( WHANG EQ '000' OR OPUPW NE '000' )
AND AUGST EQ SPACE )
stating ' An SQL error occurred when accessing a table '
( DBIF_RSQL_SQL_ERROR ).
The problem happens only in testing server where the select query fetches data from DFKKOP using Custom Index ( Z-index ) wherein in the Pre-Integration server, the select query uses the Std. Index for fetching and the program is working fine.
I am really confused why the program uses Different Indexes in Different Servers.
The order of the fields in the Select Query matches the order in the Std. Index ( as I said it happens in Pre-Integration Server )but it is not matching with the order of the Z-index ( still the program uses this Index in Testing Server & fails ).
Please Help me to solve this Issue.
Regards,
Yogesh.Hi Volker,
We couldn't check the Index with which that particular Select query in the standard SAP program is using to fetch the data from DFFKOP table in Production.
In pre-integration environment wherein the program is getting executed successfully the Standard Index '3' is being used.
In testing environment, the query uses one of the Z-indexes ( the program fails ) for the same query.
The order of the fields in the select query :
MANDT
ABWBL
WHANG
OPUPW
AUGST
The order of the fields in the Standard Index ( 3 ) :
MANDT
ABWBL
AUGST
WHGRP
The order of the fields in the Z-index :
MANDT
AUGST
VKONT
BUDAT
AUGBD
Regards,
Yogesh -
Problem in Submiting Background Job
Hi,
I am submitting a Program in Background by using JOB_OPEN and SUBMIT Program and JOB_CLOSE.
After submiting Job was terminated with following log.
04/07/2009 11:34:05 Job started 00 516 S
04/07/2009 11:34:05 Step 001 started (program YSDU_CUSTOMER_DUP_CHECK, variant &0000000000002, user ID JAGASEK) 00 550 S
04/07/2009 11:34:05 Cannot perform frontend function in batch input mode FES 002 E
04/07/2009 11:34:05 Job cancelled after system exception ERROR_MESSAGE 00 564 A
Please help me.
Thanks,
Sekhar.JHi sekhar J,
It looks to me like you may be calling a function from SFES (SAP FrontEnd Services) e.g. FM GUI_UPLOAD, these cannot be used in background mode for obvious reasons. If the program is reading/writing a local file you will need to use a dataset on the application server instead. If ths is the case there are plenty of posts cocerning datasets on sdn.
Regards,
Simon -
Submit via Job- problem in code
I need to convert the PR to PO automatically, we can do this by me59n, so iam scheduling the job for the me59n program. here iam using Badi's, iam getting the PR, plant, vendor from IM_Eban from the method of Badi, reading this in internal table, zeban. now when the execute the transaction(va01) and saving, PR shouls be converted to PO. i would like to have guys look into the code, and pl correct this.
method IF_EX_ME_REQ_POSTED~POSTED .
DATA: ACTUAL_JOBNAME type tbtcjob-JOBNAME value 'Z_TEST2',
JOBCOUNT type tbtcjob-JOBCOUNT,
MSG(60) TYPE C,
STIME TYPE SY-UZEIT.
DATA: ZEBAN TYPE UEBAN.
DATA: P_BANFN(10) TYPE N.
read table IM_EBAN into Zeban index 1.
*Open the Job
CALL FUNCTION 'JOB_OPEN' " OPENING JOB
EXPORTING
JOBNAME = ACTUAL_JOBNAME " JOB NAME
IMPORTING
JOBCOUNT = JOBCOUNT.
DATA SELTAB type table of RSPARAMS.
data : sel_wa type rsparams.
Populate internal table.
MOVE: 'S_EKGRP' TO SEL_wa-SELNAME,
'I' TO SEL_WA-SIGN,
'EQ' TO SEL_WA-OPTION,
'S' TO SEL_wa-KIND,
Zeban-ekgrp TO sel_wa-LOW.
APPEND sel_wa to SELTAB.
CLEAR SEL_WA.
MOVE: 'S_FLIEF' TO SEL_wa-SELNAME,
'I' TO SEL_WA-SIGN,
'EQ' TO SEL_WA-OPTION,
'S' TO SEL_wa-KIND,
Zeban-flief TO sel_wa-LOW.
APPEND sel_wa to SELTAB.
CLEAR SEL_WA.
MOVE: 'S_WERKS' TO SEL_wa-SELNAME,
'I' TO SEL_WA-SIGN,
'EQ' TO SEL_WA-OPTION,
'S' TO SEL_wa-KIND,
Zeban-werks TO sel_wa-LOW.
APPEND sel_wa to SELTAB.
CLEAR SEL_WA.
MOVE: 'P_GBANFN' TO SEL_WA-SELNAME,
'P' TO SEL_WA-KIND,
'X' TO SEL_WA-LOW.
APPEND SEL_WA TO SELTAB.
CLEAR SEL_WA.
MOVE: ZEBAN-BANFN TO P_BANFN.
MOVE: 'S_BANFN' TO SEL_WA-SELNAME,
'I' TO SEL_WA-SIGN,
'EQ' TO SEL_WA-OPTION,
'S' TO SEL_WA-KIND,
P_BanfN TO SEL_WA-LOW,
SPACE TO SEL_WA-HIGH.
APPEND SEL_WA TO SELTAB.
CLEAR SEL_WA.
MOVE: 'P_VRTYPK' TO SEL_WA-SELNAME,
'P' TO SEL_WA-KIND,
'X' TO SEL_WA-LOW.
APPEND SEL_WA TO SELTAB.
SUBMIT RM06BB30 VIA JOB ACTUAL_JOBNAME
NUMBER JOBCOUNT
TO SAP-SPOOL DESTINATION 'NULL'
WITHOUT SPOOL DYNPRO
WITH SELECTION-TABLE SELTAB
AND RETURN.
STIME = SY-UZEIT + 900.
*Schedule the job after 15 min and Close the job.
CALL FUNCTION 'JOB_CLOSE' " CLOSING JOB
EXPORTING
JOBNAME = ACTUAL_JOBNAME
JOBCOUNT = JOBCOUNT
STRTIMMED = 'X'
TARGETSYSTEM = SY-HOST.
LASTSTRTTM = STIME.
endmethod.Hi,
Could you please let us know, what is the error you are getting.
Best regards,
Prashant -
Error while submitting standard import purchase order program
Hi,
iam submitting Standard import purchase order concurrent program, iam getting
error in view - output like
Enter value for 12: EXEC FND_CONC_STAT.COLLECT;
Enter value for 14:
in view-log like
To get the log messages for PDOI, please use the following id to query against FND_LOG_MESSAGES table:
AUDSID = 10451963
can any one help me?
Regards
BhaskarPlease paste the code here.. there may be some parameter issue while submission.
-
Problem in saving a standard program
hello
I have a problem while making changes to a standard program. We are doing an upgrade of 4.6 C to Ecc 6.0.We are doing SPAU activity now and while putting back a customer modification of standard code done in 4.6C version, i face this problem.
I able to change the standard program, but while saving it, i get an error message "Internal error". I tried debugging it and i understand that it is because of checking some enhancement points related things.
I have not worked in enhancement points; can you please suggest why is this error appearing?
Thank you.Can you tell us how was the customer modification implemented in 4.6c system i.e. User-exit or BAdI etc.
Are you trying to copy the source-code of 4.6c (inside user-exit) into enhancement points.
I have encountered "Internal error" many a times while working with ABAP Dictionary. I cannot tell exactly why it happened, but most of the times when i made changes to multiple fields of views it happened.
In order to temporarily solve the problem, I split my work into small portions & made changes to only one field and saved and activated. That way it worked. May be you can try that too.
Regards,
Saurabh -
The Problem is about Standard Back Button Function in Report Program
The Problem is about Standard Back Button Function in the Report Program.
In the Report,First call screen Then Using "write" output some information,That is ok. but In the GUI When I press back button that is standard button,it exit screen to program.
My question is how can i do When i press back button,the screen can be back forward first screen instand of exit screen to program. Thanks .This problem is solution.I call screen using T-code and submit report In PAI,at last return to PAI.That is OK.
Maybe you are looking for
-
In-app purchase of tangible goods
Hi, I like apps that teach us and our kids. I also like in-app purchases. They allow developers to offer their apps for free with some partial (but very useful) content and make money with additional content/software that they sell as add-ons. I clea
-
i have bought all my songs on my dads itunes since i was a kid and have other 600. now that im going to college i am getting my own laptop and own itunes account. how do i transfer all my songs to my new itunes account?
-
IPod shuffle wont play but shows up on PC/iTunes....
Hey Guys, Recently my iPod Shuffle decided to die and stop working. The battery check button doesnt work (no LED lights up) and it simply wont turn on and play any music. The most ironic thing is that, when plugged in my PC, Windows XP recognises it.
-
Hello Can someone tell me how to print to the edge of the page in Illlustrator CS4. I find that that I cannot print right up to the very edge of the page. I am printing an image onto A4 size inkjet paper. I dont want the image size to increase, just
-
I have also restarted the computer and modem.