<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520320#M239018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; My requirement is :-&lt;/P&gt;&lt;P&gt;1.) Open dataset for input&lt;/P&gt;&lt;P&gt;2.) Submit to RFBIBL00&lt;/P&gt;&lt;P&gt;3.) Submit to RSBDCSUB&lt;/P&gt;&lt;P&gt;4.) Move the file to the archive directory&lt;/P&gt;&lt;P&gt;5.) Get the status of the job (failure or completed) in a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have done till Step 4. ... for Step 5 ... I am planning to write a generic program or FM say ZSTATUSLOG ... So that ZSTATUSLOG can be used for all the interfaces ... This program or FM I'll be calling in the main program .... (If I write a program then my command will be SUBMIT ZSTATUSLOG VIA SELECTION-SCREEN USING SELECTION-SET 'VARIANT1'... else if I write an FM then I will use the command CALL FUNCTION ZSTATUSLOG)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  My problem is that if the main program fails during step 2. (example is line items coming more than 950...) then the subsequent code is not executed ... How do I code so that the pointer can jump from Step 2. to Step 5. or Step 3 to Step 5... in case of failure jobs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;SB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Aug 2006 04:18:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-24T04:18:21Z</dc:date>
    <item>
      <title>Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520320#M239018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; My requirement is :-&lt;/P&gt;&lt;P&gt;1.) Open dataset for input&lt;/P&gt;&lt;P&gt;2.) Submit to RFBIBL00&lt;/P&gt;&lt;P&gt;3.) Submit to RSBDCSUB&lt;/P&gt;&lt;P&gt;4.) Move the file to the archive directory&lt;/P&gt;&lt;P&gt;5.) Get the status of the job (failure or completed) in a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have done till Step 4. ... for Step 5 ... I am planning to write a generic program or FM say ZSTATUSLOG ... So that ZSTATUSLOG can be used for all the interfaces ... This program or FM I'll be calling in the main program .... (If I write a program then my command will be SUBMIT ZSTATUSLOG VIA SELECTION-SCREEN USING SELECTION-SET 'VARIANT1'... else if I write an FM then I will use the command CALL FUNCTION ZSTATUSLOG)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  My problem is that if the main program fails during step 2. (example is line items coming more than 950...) then the subsequent code is not executed ... How do I code so that the pointer can jump from Step 2. to Step 5. or Step 3 to Step 5... in case of failure jobs...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;SB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 04:18:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520320#M239018</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T04:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520321#M239019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SB,&lt;/P&gt;&lt;P&gt;I think writing step 5 in the same program is not a very good idea. Yes you are right regarding the fifth step as a separate FM, but I guess you have to call this FM in another program.  You can schedule your main program and status-get program in a job as 2 different steps, 2nd will be called once 1st is complete and will update the text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another SIMPLE/easy solution is :&lt;/P&gt;&lt;P&gt;Update the status text file after every step. In the begining at STEP 1 set the status in file as JOB-FAILED, and once all the steps are complete update the status in file as JOB-SUCCESSFUL. Here even if step 3/4 fails the status in file is JOB-FAILED, thats what is required. You can also update these status at every step, depending on requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal&lt;/P&gt;&lt;P&gt;Reward if helpful &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vishal Tyagi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 04:31:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520321#M239019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T04:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520322#M239020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SB,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From functional perspective, i dont think if there are more than 950 line items, there should be a program failure rather ur program should be call RFBIBL00 again for posting rest of the line items in another FI document. It means that if there are 1000 line items, then 2 FI doc should be posted with 950 and 50 line items respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if your requirement is so, call your ZSTATUSLOG pgm or FM after RSBDCSUB pgm has scheduled BDC. It should read TBTCO table to get the status field value and display status accordingly. Thereafter u can move file to archive directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In short ur sequence should be &lt;/P&gt;&lt;P&gt;1.) Open dataset for input&lt;/P&gt;&lt;P&gt;2.) Submit to RFBIBL00&lt;/P&gt;&lt;P&gt;3.) Submit to RSBDCSUB&lt;/P&gt;&lt;P&gt;4.) Get the status of the job (failure or completed) in a text file.&lt;/P&gt;&lt;P&gt;5.) Move the file to the archive directory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Vikram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward for helpful replies!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 04:31:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520322#M239020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T04:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520323#M239021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any more suggesstion for me to excecute Step 5...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 21:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520323#M239021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T21:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520324#M239022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you submitting RFBIBL00 and RSBDCSUB in one job, two steps or two jobs, one step each?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 21:40:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520324#M239022</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T21:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520325#M239023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vishal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  From SM36 I defined a new job called Z_VEN_INV_TEST... this calls the main prg... then in the additional step I gave the ZSTATUSLOG program with variant "Z_VEN_INV_TEST" ... but because it is immdeiately getting executed ... ( I have no control to schedule the additonal step after some time gap )... the text file is not getting updated ... I think there is some time gap between the main prg getting executed and Table V_OP updation ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding your second suggestion ... it's definately easy but not generic... I want something which will help to just plug n play with other interface jobs instead of writing seperate logics for each one...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 21:48:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520325#M239023</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T21:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520326#M239024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Srinivas both RFBIBL00 &amp;amp; RSBDCSUB are in one prg only ... my requirement is to create a log report that the interface ran ... &amp;amp; I wanted a generic solution...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 21:50:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520326#M239024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T21:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520327#M239025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I mislead you. My question was whether your SUBMITs are done with the VIA JOB option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use function module BP_JOB_STATUS_GET to read the status of a particular job.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 22:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520327#M239025</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T22:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520328#M239026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK ... but then where do I code it ??... In the main program or in a seperate program ??... If I have to code it in seperate prg... then I have to schedule this prg as a job ... how do I schedule ??... the interface job keeps running thru out the day...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 22:22:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520328#M239026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T22:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520329#M239027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have scheduled this prg as a job which runs twice a day...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report ZVENDOR_INVOICE.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to get the list of all the files in a specific directory of&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;application server.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM GET_DIRECTORY_FILES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to process the logic&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  PERFORM PROCESS_FILES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF FG_FLAG = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to move the processed files to archive directory&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    PERFORM MOVE_FILES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  GET_DIRECTORY_FILES&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to get the list of all the files in a specific directory of&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;application server.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_DIRECTORY_FILES .&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RZL_READ_DIR_LOCAL'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      NAME           = p_new&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      FILE_TBL       = T_LISTFILES&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      ARGUMENT_ERROR = 1&lt;/P&gt;&lt;P&gt;      NOT_FOUND      = 2&lt;/P&gt;&lt;P&gt;      OTHERS         = 3.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;  CLEAR T_LISTFILES.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " GET_DIRECTORY_FILES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  PROCESS_FILES&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Perform to process the logic&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM PROCESS_FILES .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT T_LISTFILES .&lt;/P&gt;&lt;P&gt;    DELETE T_LISTFILES WHERE NAME = '.' .&lt;/P&gt;&lt;P&gt;    DELETE T_LISTFILES WHERE NAME = '..'.&lt;/P&gt;&lt;P&gt;    CLEAR   T_LISTFILES.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Open the file&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT T_LISTFILES.&lt;/P&gt;&lt;P&gt;    CONCATENATE p_new&lt;/P&gt;&lt;P&gt;                '/'&lt;/P&gt;&lt;P&gt;                T_LISTFILES-NAME&lt;/P&gt;&lt;P&gt;           INTO V_FILEPATH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    OPEN DATASET V_FILEPATH FOR INPUT IN TEXT MODE ENCODING DEFAULT&lt;/P&gt;&lt;P&gt;                                              MESSAGE V_MSG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   WRITE: V_FILEPATH.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      WRITE: 'File cannot be opened', V_MSG.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Reading the file.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    DO.&lt;/P&gt;&lt;P&gt;      READ DATASET V_FILEPATH INTO T_INPUTFILE.&lt;/P&gt;&lt;P&gt;      IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Capture session name.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        IF T_INPUTFILE+0(1) = '0'.&lt;/P&gt;&lt;P&gt;          V_SESS_NAME = T_INPUTFILE+1(12).&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;          APPEND T_INPUTFILE.&lt;/P&gt;&lt;P&gt;          CLEAR  T_INPUTFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Close the file.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        CLOSE DATASET V_FILEPATH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Submit the input file to the standard SAP program 'RFBIBL00'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;        IF T_INPUTFILE[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;          SUBMIT RFBIBL00 WITH DS_NAME = V_FILEPATH&lt;/P&gt;&lt;P&gt;                          WITH FL_CHECK = SPACE&lt;/P&gt;&lt;P&gt;                          WITH CALLMODE = 'B'&lt;/P&gt;&lt;P&gt;                          WITH XLOG      = 'X'&lt;/P&gt;&lt;P&gt;                          AND RETURN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;            FG_FLAG = 'X'.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF P_RUNBI = 'X'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Perform to run the batch input session.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          PERFORM RUN_BATCH_INPUT_SESSION.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CLEAR  : T_INPUTFILE,&lt;/P&gt;&lt;P&gt;                 V_SESS_NAME.&lt;/P&gt;&lt;P&gt;        REFRESH  : T_INPUTFILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDFORM.                    " PROCESS_FILES&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  MOVE_FILES&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Perform to move the processed files to archive directory&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM MOVE_FILES .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT T_LISTFILES.&lt;/P&gt;&lt;P&gt;    CONCATENATE p_new&lt;/P&gt;&lt;P&gt;                '/'&lt;/P&gt;&lt;P&gt;                T_LISTFILES-NAME&lt;/P&gt;&lt;P&gt;           INTO V_FILEPATH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CONCATENATE V_FILEPATH&lt;/P&gt;&lt;P&gt;                p_arch&lt;/P&gt;&lt;P&gt;           INTO ARCH_DIR&lt;/P&gt;&lt;P&gt;           SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'SXPG_COMMAND_EXECUTE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        COMMANDNAME                         = C_CMD_TEST&lt;/P&gt;&lt;P&gt;        ADDITIONAL_PARAMETERS               = ARCH_DIR&lt;/P&gt;&lt;P&gt;        OPERATINGSYSTEM                     = SY-OPSYS&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TARGETSYSTEM                        = SY-HOST&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DESTINATION                         =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STDOUT                              = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STDERR                              = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TERMINATIONWAIT                     = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  TRACE                               =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STATUS                              =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXITCODE                            =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        EXEC_PROTOCOL                       = T_MOVETODIR&lt;/P&gt;&lt;P&gt;   EXCEPTIONS&lt;/P&gt;&lt;P&gt;     NO_PERMISSION                       = 1&lt;/P&gt;&lt;P&gt;     COMMAND_NOT_FOUND                   = 2&lt;/P&gt;&lt;P&gt;     PARAMETERS_TOO_LONG                 = 3&lt;/P&gt;&lt;P&gt;     SECURITY_RISK                       = 4&lt;/P&gt;&lt;P&gt;     WRONG_CHECK_CALL_INTERFACE          = 5&lt;/P&gt;&lt;P&gt;     PROGRAM_START_ERROR                 = 6&lt;/P&gt;&lt;P&gt;     PROGRAM_TERMINATION_ERROR           = 7&lt;/P&gt;&lt;P&gt;     X_ERROR                             = 8&lt;/P&gt;&lt;P&gt;     PARAMETER_EXPECTED                  = 9&lt;/P&gt;&lt;P&gt;     TOO_MANY_PARAMETERS                 = 10&lt;/P&gt;&lt;P&gt;     ILLEGAL_COMMAND                     = 11&lt;/P&gt;&lt;P&gt;     WRONG_ASYNCHRONOUS_PARAMETERS       = 12&lt;/P&gt;&lt;P&gt;     CANT_ENQ_TBTCO_ENTRY                = 13&lt;/P&gt;&lt;P&gt;     JOBCOUNT_GENERATION_ERROR           = 14&lt;/P&gt;&lt;P&gt;     OTHERS                              = 15&lt;/P&gt;&lt;P&gt;              .&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " MOVE_FILES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  RUN_BATCH_INPUT_SESSION&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Perform to run the batch input session&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM RUN_BATCH_INPUT_SESSION .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF CALLMODE = 'B' AND Z_VERARB = 'X'.&lt;/P&gt;&lt;P&gt;    SUBMIT RSBDCSUB WITH MAPPE = V_SESS_NAME&lt;/P&gt;&lt;P&gt;                    WITH VON = SY-DATUM&lt;/P&gt;&lt;P&gt;                    WITH BIS = SY-DATUM&lt;/P&gt;&lt;P&gt;                    AND RETURN.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 EXPORTING LIST TO MEMORY.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 22:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520329#M239027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T22:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520330#M239028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot get the status of your SUBMITs if you are doing them like this. The problem with SUBMIT is that it creates the spool instead of giving you any status ( like sy-subrc value or exceptions ). So if your RFBIBL00 execution fails for some reason, you will get the log in the spool but your sy-subrc will still be 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is to do the following steps.&lt;/P&gt;&lt;P&gt;call JOB_OPEN function module and get the job number.&lt;/P&gt;&lt;P&gt;SUBMIT RFBIBL00 VIA JOB job number from above.&lt;/P&gt;&lt;P&gt;SUBMIT RSBDCSUB VIA JOB job number from above.&lt;/P&gt;&lt;P&gt;call JOB_CLOSE function module using job number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then find the job status of the above job using the function module that I gave you previously. But even in this case, by the time you reach step 5, your job above may not be completed. So either you have to wait until the above is finished and then read the spool/log of that job using BP_JOBLOG_READ and BAPI_XBP_JOB_SPOOLLIST_READ.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 22:45:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520330#M239028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T22:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520331#M239029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But Sri.. I need something which I can use for all interface jobs... Can there be any other way ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Aug 2006 23:30:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query/m-p/1520331#M239029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-24T23:30:05Z</dc:date>
    </item>
  </channel>
</rss>

