<?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 Re: Program not working ib background in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394242#M1545895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't use GUI_UPLOAD in a background job as it's designed to load files from the presentation server which isn'r accessible from a background job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For background processing you should use OPEN DATASET on a file that you've loaded to the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could add a switch in your program to allow it to run in foreground and background.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Nov 2010 09:38:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-12T09:38:08Z</dc:date>
    <item>
      <title>Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394240#M1545893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: background/foreground/GUI problems = FAQ, please search before posting.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I have a program which is not working in background.It actuly takes the file and using GUI_upload i upload it into ITAb and then modify the database table based on this. But when i process this in foreground it working and updating the table.But when i scedule in background the job is getting over in 1-2 sec and not updating the table.&lt;/P&gt;&lt;P&gt;Please help me. below is the code for your refrence:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:begin of i_tab occurs 0,&lt;/P&gt;&lt;P&gt;      Bp1 like DATAbase table,&lt;/P&gt;&lt;P&gt;      Bp2 like  database table,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     trf1 type string,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     trf2 type string,&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     status type string,&lt;/P&gt;&lt;P&gt;  end of i_tab.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;data: BP_ver type STANDARD TABLE OF DATAbase table      with header line ,&lt;/P&gt;&lt;P&gt;      w_ver type  ZVERS_BUT050_CUR .&lt;/P&gt;&lt;P&gt;DATA: it_tab type filetable,&lt;/P&gt;&lt;P&gt;    gd_subrc TYPE i,&lt;/P&gt;&lt;P&gt;    file_name TYPE string,&lt;/P&gt;&lt;P&gt;    path TYPE string.&lt;/P&gt;&lt;P&gt;DATA : lw_file TYPE file_table.&lt;/P&gt;&lt;P&gt;DATA: LIN TYPE I.&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;*Input File&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN begin of block blk with frame title text-100.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN SKIP 2.&lt;/P&gt;&lt;P&gt;parameters : p_file like rlgrap-filename .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN end of block blk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;/P&gt;&lt;P&gt;  CLEAR:  file_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_gui_frontend_services=&amp;gt;file_open_dialog&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      window_title     = 'Select only Text File'&lt;/P&gt;&lt;P&gt;      default_filename = '*.txt'&lt;/P&gt;&lt;P&gt;      multiselection   = ' '&lt;/P&gt;&lt;P&gt;    CHANGING&lt;/P&gt;&lt;P&gt;      file_table       = it_tab&lt;/P&gt;&lt;P&gt;      rc               = gd_subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE  it_tab INTO lw_file INDEX 1.&lt;/P&gt;&lt;P&gt;  file_name = lw_file.&lt;/P&gt;&lt;P&gt;  p_file = file_name.&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;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*Upload the file&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      FILENAME                      = FILE_NAME&lt;/P&gt;&lt;P&gt;     FILETYPE                      = 'ASC'&lt;/P&gt;&lt;P&gt;   HAS_FIELD_SEPARATOR           = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  HEADER_LENGTH                 = 0&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  READ_BY_LINE                  = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  DAT_MODE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  CODEPAGE                      = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      DATA_TAB                    = i_tab&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FILE_OPEN_ERROR               = 1&lt;/P&gt;&lt;P&gt;   FILE_READ_ERROR               = 2&lt;/P&gt;&lt;P&gt;   NO_BATCH                      = 3&lt;/P&gt;&lt;P&gt;   GUI_REFUSE_FILETRANSFER       = 4&lt;/P&gt;&lt;P&gt;   INVALID_TYPE                  = 5&lt;/P&gt;&lt;P&gt;   NO_AUTHORITY                  = 6&lt;/P&gt;&lt;P&gt;   UNKNOWN_ERROR                 = 7&lt;/P&gt;&lt;P&gt;   BAD_DATA_FORMAT               = 8&lt;/P&gt;&lt;P&gt;   HEADER_NOT_ALLOWED            = 9&lt;/P&gt;&lt;P&gt;   SEPARATOR_NOT_ALLOWED         = 10&lt;/P&gt;&lt;P&gt;   HEADER_TOO_LONG               = 11&lt;/P&gt;&lt;P&gt;   UNKNOWN_DP_ERROR              = 12&lt;/P&gt;&lt;P&gt;   ACCESS_DENIED                 = 13&lt;/P&gt;&lt;P&gt;   DP_OUT_OF_MEMORY              = 14&lt;/P&gt;&lt;P&gt;   DISK_FULL                     = 15&lt;/P&gt;&lt;P&gt;   DP_TIMEOUT                    = 16&lt;/P&gt;&lt;P&gt;   OTHERS                        = 17&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;&lt;/P&gt;&lt;P&gt;  loop at i_tab.&lt;/P&gt;&lt;P&gt;    if i_tab-status = 'Yes'.&lt;/P&gt;&lt;P&gt;      i_tab-status = 'V'.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      i_tab-status = 'I'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;    modify i_tab.&lt;/P&gt;&lt;P&gt;  endloop.&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;  if i_tab is not INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    select * from DATAbase table into CORRESPONDING FIELDS OF TABLE  BP_ver FOR ALL ENTRIES IN i_tab&lt;/P&gt;&lt;P&gt;      where PARTNER1 = i_tab-Bp1 and PARTNER2 = i_tab-bp2  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Update the table&lt;/P&gt;&lt;P&gt;  loop at BP_ver .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    clear i_tab.&lt;/P&gt;&lt;P&gt;    read TABLE i_tab  with key bp1 = BP_ver-PARTNER1 bp2 = BP_ver-PARTNER2  .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   if i_tab-bp1 = w_ver-PARTNER1 and i_tab-bp2 = w_ver-PARTNER2.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    BP_ver-PARTNER1 = i_tab-bp1 .&lt;/P&gt;&lt;P&gt;    BP_ver-PARTNER2 = i_tab-bp2 .&lt;/P&gt;&lt;P&gt;    BP_ver-Z_CURRENTLY_VALI = i_tab-status .&lt;/P&gt;&lt;P&gt;    modify BP_ver TRANSPORTING Z_CURRENTLY_VALI .&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  update DATAbase table from table bp_ver[] .&lt;/P&gt;&lt;P&gt;&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;  if sy-SUBRC eq 0.&lt;/P&gt;&lt;P&gt;    commit work.&lt;/P&gt;&lt;P&gt;    message 'Table DATAbase table Updated Sucsussfully' type 'S'.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    message 'Table Not Updated !!! Check the file data or input' type 'S'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Nov 12, 2010 11:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:34:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394240#M1545893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394241#M1545894</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;     Look at the coding in FM GUI_UPLOAD ... This does not work in background ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Batch mode is not supported&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF sy-batch = 'X'.&lt;/P&gt;&lt;P&gt;    MESSAGE ID 'FES' TYPE 'E' NUMBER '002' RAISING NO_BATCH.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394241#M1545894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394242#M1545895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't use GUI_UPLOAD in a background job as it's designed to load files from the presentation server which isn'r accessible from a background job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For background processing you should use OPEN DATASET on a file that you've loaded to the application server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could add a switch in your program to allow it to run in foreground and background.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:38:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394242#M1545895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394243#M1545896</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;You have to use the OPEN DATASET command to read your file. The GUI_upload FM does not work in background.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;George Zervas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:39:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394243#M1545896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:39:12Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394244#M1545897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;GUI_upload is not suported in batchmode then which FM we can use to upload in background.&lt;/P&gt;&lt;P&gt;Please help me your inputs are realy helping me.&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:40:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394244#M1545897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394245#M1545898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said in my reply you need to put the file on the application server and then use the OPEN DATASET, READ DATSET and CLOSE DATASET commands to process the file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:42:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394245#M1545898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394246#M1545899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Thanks for the reply.&lt;/P&gt;&lt;P&gt;I need to upload the file from my desktop to a table so how to use opendataset to upload the file from presentation in background. please help me with the code.&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394246#M1545899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394247#M1545900</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;      I don't think there is any way to upload data from desktop in back ground.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Srini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:46:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394247#M1545900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394248#M1545901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can still load the data to your internal table and update the database in background but you can't use GUI_UPLOAD - you have to use the dataset processing commands.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:47:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394248#M1545901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Program not working ib background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394249#M1545902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to put the file at application server. Use tcode - CG3Z&lt;/P&gt;&lt;P&gt;Then as said by other use, OPEN, READ and CLOSE dataset commands.&lt;/P&gt;&lt;P&gt;There is no ways to upload the file from presentation server for a background job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Munish Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Nov 2010 09:54:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-not-working-ib-background/m-p/7394249#M1545902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-12T09:54:31Z</dc:date>
    </item>
  </channel>
</rss>

