Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function module to updload data from internal table to application server

Former Member
0 Likes
605

Hi,

Is there any function module to upload data from internal table to application server?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
579

Hi

Use the Tcodes

<b>CG3Y and

CG3Z</b> to upload from Local to Application server and vice versa.

Reward points for useful Answers

Regards

Anji

5 REPLIES 5
Read only

Former Member
0 Likes
579

Hi Santhosh,

Do you means upload date from Application Serfver to Internal table?

Then you can use read datasets to read the file.

See File transaction help of SAP.

Reward if useful!

Read only

Former Member
0 Likes
579

Hi Santhosh,

You dont need a FM to do this.Instead use this


OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER XML_content TO FNAME.
CLOSE DATASET FNAME.

where fname is the path to the file name.

Regards

Aneesh.

Read only

Former Member
0 Likes
579

Don't think so....You need to use


OPEN DATASET

Greetings,

Blag.

Read only

Former Member
0 Likes
579

Hello,

There is no FM for that.

Just use OPEN DATASE.. TRANSFER...CLOS DATASET.

Check this sample:


*&---------------------------------------------------------------------*
*& Report  ZV_TEST1                                                    *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

REPORT  ZV_TEST1                                .
PARAMETERS: P_FILE(132).
DATA: FILE  TYPE  STRING.
FILE = P_FILE.
DATA: BEGIN OF G_T_DATA OCCURS 0,
        MATNR LIKE MARA-MATNR,
*        BRGEW(13)," LIKE MARA-BRGEW,
        NTGEW LIKE MARA-NTGEW,
*        GEWEI LIKE MARA-GEWEI,
*         LINE(81),
     END OF G_T_DATA.
SELECT MATNR NTGEW FROM MARA UP TO 20 ROWS INTO TABLE G_T_DATA.
DATA: BEGIN OF ITAB OCCURS 0,
*        MATNR LIKE MARA-MATNR,
*        BRGEW(13)," LIKE MARA-BRGEW,
*        NTGEW LIKE MARA-NTGEW,
*        GEWEI LIKE MARA-GEWEI,
         LINE(81),
     END OF ITAB.
*LOOP AT G_T_DATA.
*  MOVE G_T_DATA TO ITAB.
*  APPEND ITAB.
*  CLEAR ITAB.
*ENDLOOP.


DATA: LINE(85),LV_NTGEW(17).

OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC = 0.
  LOOP AT G_T_DATA.
    G_T_DATA-NTGEW = '10'.
    WRITE: G_T_DATA-NTGEW TO LV_NTGEW.
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
      EXPORTING
        INPUT        = G_T_DATA-MATNR
      IMPORTING
        OUTPUT       = G_T_DATA-MATNR
      EXCEPTIONS
        LENGTH_ERROR = 1
        OTHERS       = 2.
    CONCATENATE  G_T_DATA-MATNR '|' LV_NTGEW '#' INTO LINE.
    CONDENSE LINE.
    TRANSFER LINE TO P_FILE.
  ENDLOOP.
ENDIF.
CLOSE DATASET P_FILE.
*DELETE DATASET P_FILE.

WRITE: SY-SUBRC.

Read only

Former Member
0 Likes
580

Hi

Use the Tcodes

<b>CG3Y and

CG3Z</b> to upload from Local to Application server and vice versa.

Reward points for useful Answers

Regards

Anji