BDC for transaction AC02, error opening dataset returning 0.

Here is the code.
Help me ASAP..             
<unreadable code removed by moderator>
Moderator message: please do some own research before posting, only posts text with less than 5000 characters, check formatting before posting, do not use terms like "ASAP".
Edited by: Thomas Zloch on Jan 13, 2012

  open dataset                                                       *
FORM OPEN_DATASET USING P_DATASET.
  OPEN DATASET P_DATASET
               FOR INPUT IN TEXT MODE
               ENCODING DEFAULT.
  IF SY-SUBRC <> 0.
    WRITE: / TEXT-E00, SY-SUBRC.
    STOP.
  ENDIF.
ENDFORM.
  create batchinput session                                          *
  (not for call transaction using...)                                *
FORM OPEN_GROUP.
  IF SESSION = 'X'.
    SKIP.
    WRITE: /(20) 'Create group'(I01), GROUP.
    SKIP.
  open batchinput group
    CALL FUNCTION 'BDC_OPEN_GROUP'
         EXPORTING  CLIENT   = SY-MANDT
                    GROUP    = GROUP
                    USER     = USER
                    KEEP     = KEEP
                    HOLDDATE = HOLDDATE.
    WRITE: /(30) 'BDC_OPEN_GROUP'(I02),
            (12) 'returncode:'(I05),
                 SY-SUBRC.
  ENDIF.
ENDFORM.
I'm using these performs because they appeared automatically when the recording became a program.

Similar Messages

  • Error opening dataset, return code:        8

    Hi,
    I'm passing the information from a txt to a transparente table. The problem is that it throws me the following message: Error opening dataset, return code:        8  .
    When I debug it the first row of information enters to the internal table but after it this erro comes.
    The code is the following:
    DATA: BEGIN OF record,
    data element: TABNAME
            tablename_001(030),
    data element: DESCR40
            des_002(040),
    data element: TYKLA
            tipo_003(015),
    data element: QUANTITY_I
            quan_004(011),
    data element: PRICE
            precio_005(021),
    data element: TOT01
            total_006(017),
          END OF record.
    End generated data section ***
    DATA:
    BEGIN OF i_tabla OCCURS 0,
    dest(40),
    type(15),
    quan(10),
    precio(15),
    tot(15),
    END OF i_tabla.
    PARAMETERS:
    p_user LIKE apqi-userid OBLIGATORY DEFAULT  sy-uname,
    p_fich LIKE rlgrap-filename OBLIGATORY
    DEFAULT: 'C:\Documents and Settings\lseri\My Documents\Book1.txt'.
    START-OF-SELECTION.
      CALL FUNCTION 'UPLOAD'
       EXPORTING
      CODEPAGE                      = ' '
         filename                      = p_fich
         filetype                      = 'DAT'
        TABLES
          data_tab                      = i_tabla
       EXCEPTIONS
         conversion_error              = 1
         invalid_table_width           = 2
         invalid_type                  = 3
         no_batch                      = 4
         unknown_error                 = 5
         gui_refuse_filetransfer       = 6
         OTHERS                        = 7
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      PERFORM open_dataset USING dataset.
      PERFORM open_group.
      LOOP AT i_tabla FROM 2.
    PERFORM bdc_dynpro      USING 'SAPLSETB' '0230'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'DATABROWSE-TABLENAME'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ANLE'.
        PERFORM bdc_field       USING 'DATABROWSE-TABLENAME'
                                      record-tablename_001.
        PERFORM bdc_dynpro      USING '/1BCDWB/DBZSTOCK_TEST' '0101'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'ZSTOCK_TEST-TOTAL'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=SAVE'.
        PERFORM bdc_field       USING 'ZSTOCK_TEST-DES'
                                      record-des_002.
        PERFORM bdc_field       USING 'ZSTOCK_TEST-TIPO'
                                      record-tipo_003.
        PERFORM bdc_field       USING 'ZSTOCK_TEST-QUAN'
                                      record-quan_004.
        PERFORM bdc_field       USING 'ZSTOCK_TEST-PRECIO'
                                      record-precio_005.
        PERFORM bdc_field       USING 'ZSTOCK_TEST-TOTAL'
                                      record-total_006.
        PERFORM bdc_dynpro      USING '/1BCDWB/DBZSTOCK_TEST' '0101'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/EBACK'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'ZSTOCK_TEST-DES'.
        PERFORM bdc_dynpro      USING 'SAPLSETB' '0230'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/EBACK'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'DATABROWSE-TABLENAME'.
        PERFORM bdc_transaction USING 'SE16'.
      ENDLOOP.
      PERFORM close_group.
      PERFORM close_dataset USING dataset.
    Please help me!
    Thanks

      open dataset                                                       *
    FORM OPEN_DATASET USING P_DATASET.
      OPEN DATASET P_DATASET
                   FOR INPUT IN TEXT MODE
                   ENCODING DEFAULT.
      IF SY-SUBRC <> 0.
        WRITE: / TEXT-E00, SY-SUBRC.
        STOP.
      ENDIF.
    ENDFORM.
      create batchinput session                                          *
      (not for call transaction using...)                                *
    FORM OPEN_GROUP.
      IF SESSION = 'X'.
        SKIP.
        WRITE: /(20) 'Create group'(I01), GROUP.
        SKIP.
      open batchinput group
        CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = GROUP
                        USER     = USER
                        KEEP     = KEEP
                        HOLDDATE = HOLDDATE.
        WRITE: /(30) 'BDC_OPEN_GROUP'(I02),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ENDIF.
    ENDFORM.
    I'm using these performs because they appeared automatically when the recording became a program.

  • BDC for transaction AC02, output the activity number on screen

    HI,
              how to get the system created activity number on to the output screen after completion of BDC, data transfer using call transaction.
    with regards,
    sagar.

    Hi,
    Do you want that once the BDC is finished then it should stay on same screen with activity number if yes you will get the activity number in your BDCMSG table. Using that you can set paramter id ASN and do a call transaction again.
    Please let us know if your requirement is different from the above one.
    thanks
    Nabheet

  • BDC for Transaction WB02

    Hi,
       I am trying to write BDC for transaction WB02 , wherein each site(Plant) in our company is to be made a customer of each other, so as to fecilitate inter-site  movement of goods. the transaction works fine normally, but at the time of recording it comes to screen '315' and gets stuck and dont move ahead or either go back, it just gets stuck there, and has to be terminated.. i tried to replicate the transaction thru' BDC but it is getting stuck at the same screen.. can anybody tell me why this is happening and the possible solution for it..
    thanks.
    sharon

    Hi,
    What u can do is Read your Messages table with message types E(Error) and A(Abort). IF NOT sy-subrc IS INITIAlL means your transaction is successfull. So u can give your custom message saying IDOC sent successfully.
    READ TABLE IT_BDCMSGCOLL WITh KEY TYPE = 'E'.
    IF NOT sy-subrc IS INITIAL.
      READ TABLE IT_BDCMSGCOLL WITH KEY TYPE = 'A'
      IF NOT sy-subrc IS INITIAL.
      MESSAGE i000 WITH 'IDOC sent successfully'.
      ELSE.
      MESSAGE i000 WITH 'Problem in sending IDOC'.
      ENDIF.
    ELSE.
      MESSAGE i000 WITH 'Problem in sending IDOC'.
    ENDIF.
    Thanks,
    Vinod.

  • BDC for transaction J1IFQ

    Hi Experts,
    I am trying to develop BDC for transaction J1IFQ .
    When I do recording at the end I press SAVE it give me message that record is reconcilie and then I press logout.
    But when I use same recording in my program it dosn't save data. I am not able to find out what is the problem, please guide me.
    Thanking you.

    Hi Narayani
    It seems you need to inspect the new flow of the transaction and your BDC program more carefully. You might have skiped somethings to change.
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Program does BDC for transaction F-52 or f-53

    Hi GuruI am functional person and working with a developer in a program . The program does BDC for transaction F-52 or f-53 . I am uploading a file ,so that the program picks it and o either F-52 or F-53 based on condition. When i try to upload the program with mulitple record ,i am getting the message difference is too large to clear . If i execute the same program without doing any changes again i can see few more records getting posted . when i do next time remaining records are posted . Insted of getting posted in one ,I have to execute the program more than once .can any one help me out why this is happening

    i think you should ask  your programmer to use transaction SM35 to process the BDC in foreground mode (first changing the mode to A). I would think you will see what's going wrong then. There are a few transactions that look different in foreground mode than in background and you will see where the difference is if you use this method to process

  • Creating bdc for transaction f-02 ?

    Hi People,
    I am going a bdc for transaction f-02 ..... my template involves 7 posting keys ( 40 50 31 01 29 09 70 ) ... depending up
    on the posting key the next screen will change .......... can you people tel me how to do this and what are all the logic
    involved in this program ?
    thanks u all in advance.
    Siva

    Hi,
    Please use the following format for your upload file template
    DocDate1    ComCd1    Currency1    pstky1
    DocDate1    ComCd1    Currency1    pstky2
    DocDate1    ComCd1    Currency1    pstky3
    DocDate2    ComCd2    Currency2    pstky1
    DocDate2    ComCd2    Currency2    pstky2
    Then use the following logic.
    At New Currency1
    add the header data
    DocDate1    ComCd1    Currency1
    Thus this code will run only once for every new Header
    and remain in the screen till posting key are entered.
    Regards,
    Lokesh
    Edited by: Lokesh Tibbani on Sep 5, 2008 12:17 PM

  • BDC for Transaction F-02

    Hi,
    Any idea how to write BDC for transaction F-02?
    The problem is how do we upload one item after another within the same loop?
    Regards,
    Naba

    You may solve easily your problem writing the data in the LOOP like
    LOOP AT IT_BSEG
      " if first line, fill BDCDATA for header and the first line call
      " if not first line, fill BDCDATA for the bottom of the previous line
      " fill ok code for next line
      " fill BDCDATA for the current line
    ENDLOOP.
    " fill ok code for save and call transaction
    But it should be easier to use FM like [POSTING_INTERFACE_START|https://www.sdn.sap.com/irj/scn/advancedsearch?query=posting_interface_start&cat=sdn_all]; [POSTING_INTERFACE_DOCUMENT|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=posting_interface_document&adv=false&sortby=cm_rnd_rankvalue] and [POSTING_INTERFACE_END|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=posting_interface_end&adv=false&sortby=cm_rnd_rankvalue], those function modules will build the BDC flow.
    Another, and better solution is to use [BAPI_ACC_DOCUMENT_POST|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bapi_acc_document_post&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • BDC for transaction FAGLSKF

    Hi,
    I need to develop BDC for transaction FAGLSKF. I tried recording the transaction and found that the line items are not getting recorded since the transaction uses an editable ALV and not a table control. I have seen some post regarding this but everyone is saying to use some FM's but all these FM's are not yet released by SAP & even if i use it I still have to seperately take care of validations. Please let me know if anyone has faced this issue and found an alternative.
    Thanks,
    Antony

    Hi ,
    Check this BAPI Function module BAPI_ACC_STAT_KEY_FIG_POST.
    Regards,
    Ashok.

  • Hi All, I developed a BDC for transaction IE02

    Hi All, I developed a BDC for transaction IE02, when i am uploading data into this bdc 'validity period' is automatically taking the present system date, as in program i have not given any validations for this validity from Can anyone guide me on this as so why the data in validity from is taking present system date and how do i avoid it.
    Thanks..!!!
    Regards,
    Swarna

    Hi Swarna,
    AS you mention  IE02  Validity From is not editable.
    If you capturing this field in BDC then you can put hard-code date value sy-datum in this field , no need to chnage in excel or manual update every time.
    and If you are not capturing  this field in BDC  then please try to use BAPI for uploading data.
    like.
    BAPI_EQUI_CHANGE or
    BAPI_EQMT_MODIFY.
    Regards,
    Prasenjit

  • Bdc for transaction va01

    hi friends.
            how to create a bdc for va01... i need step by step procedure. please help me...

    Hi
    BDC (Batch Data Communication) works based on the data in the Internal table of structure "BDCDATA", and some of the very important lines with information (in sequence) Dynpro, Cursor-field and Data Fields, then call Transaction / Session Creation Logic.
    In Call Transaction method of BDC, the Message is handled manually using the structure "BDCMSGCOLL" and by refering to messages in "T100" Table. [Refer the standard Include BECRECX1 for more information.
    BDC can be created by Recording tool or my scracth creating a new program. Use transaction code 'SHDB'.
    A sample code by using the Recording method (Here both Call transaction and Session Method of BDC will be created by standard Recording tool [this you can find in include BDCRECX1])
    Code Only the Program, withoug Include BDCRECX1 (This std, inclu you can find)
    ***INCLUDE BDCRECX1.
    * for programs doing a data transfer by creating a batch-input session
    * and
    * for programs doing a data transfer by CALL TRANSACTION USING
    selection-screen begin of line.
    parameters session radiobutton group ctu. "create session
    selection-screen comment 3(20) text-s07 for field session.
    selection-screen position 45.
    parameters ctu radiobutton group ctu. "call transaction
    selection-screen comment 48(20) text-s08 for field ctu.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 3(20) text-s01 for field group.
    selection-screen position 25.
    parameters group(12). "group name of session
    selection-screen comment 48(20) text-s05 for field ctumode.
    selection-screen position 70.
    parameters ctumode like ctu_params-dismode default 'N'.
    "A: show all dynpros
    "E: show dynpro on error only
    "N: do not display dynpro
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 3(20) text-s02 for field user.
    selection-screen position 25.
    parameters: user(12) default sy-uname. "user for session in batch
    selection-screen comment 48(20) text-s06 for field cupdate.
    selection-screen position 70.
    parameters cupdate like ctu_params-updmode default 'L'.
    "S: synchronously
    "A: asynchronously
    "L: local
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 3(20) text-s03 for field keep.
    selection-screen position 25.
    parameters: keep as checkbox. "' ' = delete session if finished
    "'X' = keep session if finished
    selection-screen comment 48(20) text-s09 for field e_group.
    selection-screen position 70.
    parameters e_group(12). "group name of error-session
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 3(20) text-s04 for field holddate.
    selection-screen position 25.
    parameters: holddate like sy-datum.
    selection-screen comment 51(17) text-s02 for field e_user.
    selection-screen position 70.
    parameters: e_user(12) default sy-uname. "user for error-session
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 51(17) text-s03 for field e_keep.
    selection-screen position 70.
    parameters: e_keep as checkbox. "' ' = delete session if finished
    "'X' = keep session if finished
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 51(17) text-s04 for field e_hdate.
    selection-screen position 70.
    parameters: e_hdate like sy-datum.
    selection-screen end of line.
    selection-screen skip.
    selection-screen begin of line.
    selection-screen comment 1(33) text-s10 for field nodata.
    parameters: nodata default '/' lower case. "nodata
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-s11 for field smalllog.
    parameters: smalllog as checkbox. "' ' = log all transactions
    "'X' = no transaction logging
    selection-screen end of line.
    * data definition
    * Batchinputdata of single transaction
    data: bdcdata like bdcdata occurs 0 with header line.
    * messages of call transaction
    data: messtab like bdcmsgcoll occurs 0 with header line.
    * error session opened (' ' or 'X')
    data: e_group_opened.
    * message texts
    tables: t100.
    * at selection screen *
    at selection-screen.
    * group and user must be filled for create session
    if session = 'X' and
    group = space or user = space.
    message e613(ms).
    endif.
    * open dataset *
    form open_dataset using p_dataset.
    open dataset p_dataset
    for input in text mode
    encoding default.
    if sy-subrc <> 0.
    write: / text-e00, sy-subrc.
    stop.
    endif.
    endform.
    * close dataset *
    form close_dataset using p_dataset.
    close dataset p_dataset.
    endform.
    * create batchinput session *
    * (not for call transaction using...) *
    form open_group.
    if session = 'X'.
    skip.
    write: /(20) 'Create group'(i01), group.
    skip.
    * open batchinput group
    call function 'BDC_OPEN_GROUP'
    exporting client = sy-mandt
    group = group
    user = user
    keep = keep
    holddate = holddate.
    write: /(30) 'BDC_OPEN_GROUP'(i02),
    (12) 'returncode:'(i05),
    sy-subrc.
    endif.
    endform.
    * end batchinput session *
    * (call transaction using...: error session) *
    form close_group.
    if session = 'X'.
    * close batchinput group
    call function 'BDC_CLOSE_GROUP'.
    write: /(30) 'BDC_CLOSE_GROUP'(i04),
    (12) 'returncode:'(i05),
    sy-subrc.
    else.
    if e_group_opened = 'X'.
    call function 'BDC_CLOSE_GROUP'.
    write: /.
    write: /(30) 'Fehlermappe wurde erzeugt'(i06).
    e_group_opened = ' '.
    endif.
    endif.
    endform.
    * Start new transaction according to parameters *
    form bdc_transaction using tcode.
    data: l_mstring(480).
    data: l_subrc like sy-subrc.
    * batch input session
    if session = 'X'.
    call function 'BDC_INSERT'
    exporting tcode = tcode
    tables dynprotab = bdcdata.
    if smalllog <> 'X'.
    write: / 'BDC_INSERT'(i03),
    tcode,
    'returncode:'(i05),
    sy-subrc,
    'RECORD:',
    sy-index.
    endif.
    * call transaction using
    else.
    refresh messtab.
    call transaction tcode using bdcdata
    mode ctumode
    update cupdate
    messages into messtab.
    l_subrc = sy-subrc.
    if smalllog <> 'X'.
    write: / 'CALL_TRANSACTION',
    tcode,
    'returncode:'(i05),
    l_subrc,
    'RECORD:',
    sy-index.
    loop at messtab.
    select single * from t100 where sprsl = messtab-msgspra
    and arbgb = messtab-msgid
    and msgnr = messtab-msgnr.
    if sy-subrc = 0.
    l_mstring = t100-text.
    if l_mstring cs '&1'.
    replace '&1' with messtab-msgv1 into l_mstring.
    replace '&2' with messtab-msgv2 into l_mstring.
    replace '&3' with messtab-msgv3 into l_mstring.
    replace '&4' with messtab-msgv4 into l_mstring.
    else.
    replace '&' with messtab-msgv1 into l_mstring.
    replace '&' with messtab-msgv2 into l_mstring.
    replace '&' with messtab-msgv3 into l_mstring.
    replace '&' with messtab-msgv4 into l_mstring.
    endif.
    condense l_mstring.
    write: / messtab-msgtyp, l_mstring(250).
    else.
    write: / messtab.
    endif.
    endloop.
    skip.
    endif.
    ** Erzeugen fehlermappe ************************************************
    if l_subrc <> 0 and e_group <> space.
    if e_group_opened = ' '.
    call function 'BDC_OPEN_GROUP'
    exporting client = sy-mandt
    group = e_group
    user = e_user
    keep = e_keep
    holddate = e_hdate.
    e_group_opened = 'X'.
    endif.
    call function 'BDC_INSERT'
    exporting tcode = tcode
    tables dynprotab = bdcdata.
    endif.
    endif.
    refresh bdcdata.
    endform.
    * Start new screen *
    form bdc_dynpro using program dynpro.
    clear bdcdata.
    bdcdata-program = program.
    bdcdata-dynpro = dynpro.
    bdcdata-dynbegin = 'X'.
    append bdcdata.
    endform.
    * Insert field *
    form bdc_field using fnam fval.
    if fval <> nodata.
    clear bdcdata.
    bdcdata-fnam = fnam.
    bdcdata-fval = fval.
    append bdcdata.
    endif.
    endform.
    Refer this link as an example:
    <b>http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm</b>
    Alternatively, Press the Item To Top Button(The 4th from left)Under the Item Table control, every time you want to enter item details,
    This would bring the item to the top of the table control every time.
    Record the transaction this way, and code for your BDC.
    Another alternative is to use a bapi:
    <b>BAPI_SALESORDER_CREATEFROMDAT2</b>
    Regards,
    Rk
    Message was edited by:
            Rk Pasupuleti

  • Open dataset - return code 8 - msg - Permission Denied

    This is the first time this company has tried to write files to the application server. They are running under Windows. The network admin set up a folder and I am getting a return code of 8 on 'open dataset'.  When I use this function to get more information I am getting
    a run-time error that the ABAP is bad.
    What is wrong with this function call?
    pfilename =
    saberdev\blacksmith\ftpout\bsproduct.txt
    call function 'AUTHORITY_CHECK_DATASET'
    EXPORTING
    program = 'ZBS_PRODUCT_OUTBOUND_INTERFACE'
    activity = 'WRITE'
    filename = pfilename
    EXCEPTIONS
    no_authority = 1
    activity_unknown = 2
    others = 3.

    Thanks, Santosh, that helped.
    Now I am getting sy-subrc =  0 on the function call but I am still getting a return code of 8 on the open dataset.  Here is my code.
    HELP!!
       call function 'AUTHORITY_CHECK_DATASET'
             EXPORTING
                  program          = 'ZBS_PRODUCT_OUTBOUND_INTERFACE'
                  activity         = 'WRITE'
             filename         = '
    saberdev\blacksmith\ftpout\bsproduct.txt'
             EXCEPTIONS
                  no_authority     = 1
                  activity_unknown = 2
                  others           = 3.
         check sy-subrc = 0.
        data: MSG(100).
        pfilename = '
    saberdev\blacksmith\ftpout\bsproduct.txt'.
        CLEAR MSG.
        OPEN DATASET pfilename FOR OUTPUT IN TEXT MODE MESSAGE MSG.
        IF SY-SUBRC <> 0.
          CONCATENATE 'file error: ' MSG INTO MSG.
          MESSAGE E208(00) WITH MSG.
        ENDIF.

  • Open dataset - return code 8

    I am getting sy-subrc = 0 on the function call but I am still getting a return code of 8 (permission denied) on the open dataset. Here is my code.
    HELP!!
    call function 'AUTHORITY_CHECK_DATASET'
    EXPORTING
    program = 'ZBS_PRODUCT_OUTBOUND_INTERFACE'
    activity = 'WRITE'
    filename = '
    saberdev\blacksmith\ftpout\bsproduct.txt'
    EXCEPTIONS
    no_authority = 1
    activity_unknown = 2
    others = 3.
    check sy-subrc = 0.
    data: MSG(100).
    pfilename = '
    saberdev\blacksmith\ftpout\bsproduct.txt'.
    CLEAR MSG.
    OPEN DATASET pfilename FOR OUTPUT IN TEXT MODE MESSAGE MSG.
    IF SY-SUBRC <> 0.
    CONCATENATE 'file error: ' MSG INTO MSG.
    MESSAGE E208(00) WITH MSG.
    ENDIF.

    Janet - Might be worth it to check the permissions/owner on the directory.  You might be able to use function module SUBST_GET_FILE_LIST  and trans SE37 to do this.
    Regards,
    Lawrence Schmit
    Message was edited by: Lawrence Schmit
    Keep in mind that the authority check only verifies your authorization level --> it doesn't verify that the drive/path/filename is valid.  Also, it looks as if you're attempting to write to a network drive (assumed because of the back-slashes "
    ").  If you're writing to a Unix directory, use forward slashes '/'.

  • Data transfer error open dataset files

    hi,
    When i try to create a excel or text in my application server using open dataset.
    i.e
    l_filename type rlgrap-filename  value '/tmp/down.txt'.
    I got a short dump during the run time
    i got the output and put into an internal table.
    the following code has been used.
    form user_command using r_ucomm like sy-ucomm
    rs_selfield  type slis_selfield.
    if r_ucomm = 'confirm' .
    OPEN DATASET l_fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    LOOP AT it_out INTO wa_out.
      IF sy-subrc = 0.
        TRANSFER wa_out TO l_filename.
      ENDIF.
    ENDLOOP.
    endform.
    during the execution i hv a button alv grid outpu. when i click the button the file should be transferred.
    but NO authorization to open the file "/tmp/down.txt".
    and the error is pointed in the opendataset line.
    Please tell me where i am wrong . and  help me in resoving this.

    Try this..instead of moving field by field into the file 1st convert all he fields to a character stream..and then move that steam to file. Ex:
    loop at internal table into l_h_tbl_file.
    concatenate l_h_tbl_file-f1 l_h_tbl_file-f2 l_h_tbl_file-f3
    l_h_tbl_file-f4 l_h_tbl_file-f5 into g_string.
    TRANSFER g_string TO fu_wk_get_file.
    endloop.

  • BDC For Transaction MB1C

    Hi all
    i want bdc program and flat file structure for transaction MB1C to upload stock.
    If anyone have then please send me at [email protected]
    Its urgent.
    Thanks

    Hi
    use the BAPI
    BAPI_GOODSMVT_CREATE
    see the code:
    REPORT ZRICH_0001 .
    Structures for BAPI
    DATA: GM_HEADER  TYPE BAPI2017_GM_HEAD_01.
    DATA: GM_CODE    TYPE BAPI2017_GM_CODE.
    DATA: GM_HEADRET TYPE BAPI2017_GM_HEAD_RET.
    DATA: GM_ITEM    TYPE TABLE OF
                     BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.
    DATA: GM_RETURN  TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: GM_RETMTD  TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
    CLEAR: GM_RETURN, GM_RETMTD. REFRESH GM_RETURN.
    Setup BAPI header data.
    GM_HEADER-PSTNG_DATE = SY-DATUM.
    GM_HEADER-DOC_DATE   = SY-DATUM.
    GM_CODE-GM_CODE      = '04'.                                " MB1A
    Write 971 movement to table
    CLEAR GM_ITEM.
    MOVE '412'                 TO GM_ITEM-MOVE_TYPE     .
    MOVE 'Q'                 TO GM_ITEM-SPEC_STOCK.
    MOVE '3800533484'  TO GM_ITEM-MATERIAL.
    MOVE '1'     TO GM_ITEM-ENTRY_QNT.
    *MOVE 'PC'    TO GM_ITEM-ENTRY_UOM.
    MOVE '1060'  TO GM_ITEM-PLANT.
    MOVE '0007'  TO GM_ITEM-STGE_LOC.
    *MOVE '0901'   TO GM_ITEM-MOVE_REAS.
    MOVE 'P203601001' TO GM_ITEM-WBS_ELEM.
    MOVE 'P203601001' TO GM_ITEM-VAL_WBS_ELEM.
    APPEND GM_ITEM.
    Call goods movement BAPI
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
         EXPORTING
              GOODSMVT_HEADER  = GM_HEADER
              GOODSMVT_CODE    = GM_CODE
         IMPORTING
              GOODSMVT_HEADRET = GM_HEADRET
              MATERIALDOCUMENT = GM_RETMTD
         TABLES
              GOODSMVT_ITEM    = GM_ITEM
              RETURN           = GM_RETURN.
    IF NOT GM_RETMTD IS INITIAL.
      COMMIT WORK AND WAIT.
      CALL FUNCTION 'DEQUEUE_ALL'.
    ELSE.
      COMMIT WORK AND WAIT.
      CALL FUNCTION 'DEQUEUE_ALL'.
    ENDIF.
    WRITE:/ GM_RETMTD.
    LOOP AT GM_RETURN.
      WRITE:/ GM_RETURN.
    ENDLOOP.
    Reward points if useful
    Regards
    Anji

Maybe you are looking for