Skip to Content
author's profile photo Former Member
-1
Former Member

How to pick the file from application server in background

hi ,

im developing an interface program, my requirement is the interface file should be picked from application server in background from specific location at a certain time daily .is it possible how to do . any help will be appreciated

thanks to all

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    Posted on Jan 23, 2009 at 02:31 AM

    it is possible the solution has been posted many times in Forum please SEARCH

    Reported!!

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HI,

      You need to use the OPEN DATASET, READ DATASET & CLOSE DATASET to upload the data from application server to internal table and do processing as per your rquirement.

      If you want to have upload the data timely..schedule the Report program as job.

  • author's profile photo Former Member
    Former Member
    Posted on Jan 23, 2009 at 02:32 AM

    Hi,

    Try with the FM 'GUI_UPLOAD'.

    Regards,

    Aravind J M

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 23, 2009 at 03:28 AM

    in one of my requirement, the functional guys has look after the scheduling the back ground job etc. stuff......so, i guess, just u need to write the prog, by using the above key words, then the functional team will schedule it, u need not worry abt it, better keep the application server path as parameter on the selection screen, and make sure that, the file shuld over write each time ión UNIX(if its a regular job).

    thanq

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 23, 2009 at 03:39 AM

    hi

    When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.

    At anytime, a user can switch of the Personal Computers even though the job is still running in the background. Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer file.

    To choose the correct download method to used, you can check the value of SY-BATCH in your code,

    if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.

    *-- Open dataset for reading

    DATA:

    dsn(20) VALUE '/usr/test.dat',

    rec(80).

    OPEN DATASET dsn FOR INPUT IN TEXT MODE.

    IF sy-subrc = 0.

    DO.

    READ DATASET dsn INTO rec.

    IF sy-subrc <> 0.

    EXIT.

    ELSE.

    WRITE / rec.

    ENDIF.

    ENDDO.

    ENDIF.

    CLOSE DATASET dsn.

    *-- Open dataset for writing

    DATA rec(80).

    OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.

    TRANSFER rec TO '/usr/test.dat'.

    CLOSE DATASET dsn.

    *And*

    *You need to do following this thing also*

        • Create a file in AL11 ( By using CG3Y / CF3Z Transaction ) , Then it it will create a file in AL11->Home.**

            • In your code upload this file by using OPEN DATASET etc syntaxe**

            Regard

            nawa

            Add a comment
            10|10000 characters needed characters exceeded

          • Posted on Jan 23, 2009 at 04:20 AM

            Hi ,

            Could u check this program , hope use full for u.

            OPEN DATASET file IN TEXT MODE ENCODING DEFAULT FOR INPUT.

            DO .

            READ DATASET FILE INTO ITAB.

            APPEND ITAB.

            IF SY-SUBRC <> 0.

            EXIT.

            ENDIF.

            LOOP AT ITAB.

            REFRESH JTAB.

            PERFORM SUB USING 'ZVIF' '0100'.

            PERFORM SUB1 USING:'LFA1-LIFNR' ITAB-LIFNR,

            'LFA1-NAME1' ITAB-NAME1,

            'LFA1-LAND1' ITAB-LAND1.

            CALL FUNCTION 'BDC_INSERT'

            EXPORTING

            TCODE = 'ZVIF'

            TABLES

            DYNPROTAB = JTAB.

            ENDLOOP.

            ENDDO.

            CLOSE DATASET FILE.

            Regard's

            Shaik.

            Add a comment
            10|10000 characters needed characters exceeded

          • Posted on Nov 06, 2019 at 02:01 AM

            Application tables for FI

            Accounts Recievables
            1. BSID - Customer Open Items
            2. BSAD- Customer cleared items.
            Accounts Payables
            1. BSIK - Vendor Open Items
            2. BSAK- Vendor cleared items.

            Vendor Master : LFA1, LFB1, LFBK, LFBW,ADRC, ADR6
            Customer Master : KNA1, KNB1, KNBK ( KN*)
            Payment : REGUP, REGUH, RAGUV ( REGU*), PAYR
            Documents : BKPF, BSEG, BSIS, BSAD, BSAK

            Add a comment
            10|10000 characters needed characters exceeded

          • Posted on Oct 28, 2019 at 02:25 AM
            -2

            Hi,

            Here is a sample abap program for extract data from custom table and download to a file on server for your reference.

            The ZUSR02 is a view created from USR02. You can changed the code for reading different for testing.

            Regards,

            Billy

            zbcdataset01.txt

            ----------------------------------------------------------------------

            Sample ABAP Program:

            ----------------------------------------------------------------------

            REPORT ZBCDATEXTRACT01.
            TABLES:ZUSR02.
            DATA HEADER(255).
            DATA: BEGIN OF ITAB OCCURS 0,
            CLIENT like ZUSR02-CLIENT,
            BNAME like ZUSR02-BNAME,
            USTYP like ZUSR02-USTYP,
            UFLAG like ZUSR02-UFLAG,
            TRDAT like ZUSR02-TRDAT,
            PWDLGNDATE like ZUSR02-PWDLGNDATE,
            LOCNT like ZUSR02-LOCNT,
            GLTGV like ZUSR02-GLTGV,
            GLTGB like ZUSR02-GLTGB,
            END OF ITAB.
            DATA: ZSYSID(3) type C.
            DATA: ZBNAME(12) type C.
            DATA: ZUSTYP(1) type C.
            DATA: ZUFLAG(3) type C.
            DATA: ZTRDAT(8) type C.
            DATA: ZPWDLGNDATE(8) type C.
            DATA: ZLOCNT(3) type C.
            DATA: ZGLTGV(8) type C.
            DATA: ZGLTGB(8) type C.
            DATA: ZCLIENT(3) type C.

            DATA: wa_itab like line of ITAB.

            DATA: v_record(255) TYPE C.

            PARAMETERS: OUTFILE(60) DEFAULT 'R:\usr\sap\UD2\DVEBMGS12\data\ZBCDATASET01.txt' LOWER CASE.
            PARAMETERS: ZPAR2 DEFAULT ';' LOWER CASE.
            CONCATENATE 'SYSTEM_ID' 'ZUSR02-CLIENT' 'ZUSR02-BNAME' 'ZUSR02-USTYP' 'ZUSR02-UFLAG' 'ZUSR02-TRDAT' 'ZUSR02-PWDLGNDATE' 'ZUSR02-LOCNT' 'ZUSR02-GLTGV' 'ZUSR02-GLTGB' INTO HEADER SEPARATED BY ZPAR2.

            ZSYSID = SY-SYSID.


            OPEN DATASET OUTFILE FOR OUTPUT IN TEXT MODE encoding UTF-8.
            SELECT * FROM ZUSR02 INTO CORRESPONDING FIELDS OF TABLE ITAB.

            TRANSFER HEADER TO OUTFILE.

            LOOP AT ITAB into wa_itab.
            ZUFLAG = wa_itab-UFLAG.
            ZLOCNT = wa_itab-LOCNT.

            CONCATENATE ZSYSID wa_itab-client wa_itab-BNAME wa_itab-USTYP ZUFLAG wa_itab-TRDAT wa_itab-PWDLGNDATE ZLOCNT wa_itab-GLTGV wa_itab-GLTGB into v_record separated by ZPAR2.
            TRANSFER v_record TO OUTFILE.
            ENDLOOP.


            CLOSE DATASET OUTFILE.


            zbcdextract01.jpg (335.1 kB)
            zbcdataset01.txt (7.4 kB)
            Add a comment
            10|10000 characters needed characters exceeded

          • Posted on Oct 28, 2019 at 02:29 AM
            -2

            Custom view structure (ZUSR02)


            zusr02.png (41.4 kB)
            Add a comment
            10|10000 characters needed characters exceeded

          Before answering

          You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
          You must be Logged in to submit an answer.

          Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.