‎2008 May 15 2:09 PM
HI GURUS,
CAN YOU PLEASE HELP
*I WANT TO WRITE A CODE FOR CREATION OF PO USING THE BAPI_PO_CREATE1.
ist i want to put one selection screen
where using AT SELECTION SCREEN ON VALUE REQUEST FOR P_FILE i want to give browseing option for one text file with test data of PO in my local PC. then when that file is selected then all the HEADER DATA and item level data will be dispalyed.
provide code example,
points will be rewarded.
thanks *
‎2008 May 15 2:20 PM
Hi,
see
CL CL_GUI_FRONTEND_SERVICES
____________________________________________________
Short Text
Frontend Services
Functionality
The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
DATA: T_FILE_IN TYPE FILETABLE,
W_FILE_IN TYPE FILE_TABLE,
RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
CHANGING
FILE_TABLE = T_FILE_IN
RC = RC
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
OTHERS = 4.
IF SY-SUBRC = 0.
CHECK RC = 1.
READ TABLE T_FILE_IN INTO W_FILE_IN INDEX 1.
MOVE W_FILE_IN TO P_FILE.
ENDIF.
Regards
Kiran Sure
‎2008 May 15 2:17 PM
use method CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG in your at selection screen...for P_FILE.
next use CL_GUI_FRONTEND_SERVICES=>gui_upload to retrieve the file (upload the file).
Loop at internal table and call BAPI by filling the data from the internal table.
Edited by: Micky Oestreich on May 15, 2008 3:19 PM
‎2008 May 16 7:26 AM
hi,
CL_GUI_FRONTEND_SERVICES=>gui_upload to retrieve the file (upload the file).
HOW TO USE THIS??? GV MORE DETAILS PLEASE...I WANT TO read TEST PO DATA.txt file Can you give me example how the test data( Header data and Item level data is used to fill the test PO data.txt file )
Do i need to Use OPEN DATASET
CLOSE dATASET command?
how????
points will be rewarded
thanks
‎2008 May 16 7:27 AM
hi,
CL_GUI_FRONTEND_SERVICES=>gui_upload to retrieve the file (upload the file).
HOW TO USE THIS??? GV MORE DETAILS PLEASE...I WANT TO read TEST PO DATA.txt file Can you give me example how the test data( Header data and Item level data is used to fill the test PO data.txt file )
Do i need to Use OPEN DATASET
CLOSE dATASET command?
how????
points will be rewarded
thanks
‎2008 May 15 2:20 PM
Hi,
see
CL CL_GUI_FRONTEND_SERVICES
____________________________________________________
Short Text
Frontend Services
Functionality
The class CL_GUI_FRONTEND_SERVICES contains static methods for the following areas:
PARAMETERS: P_FILE LIKE RLGRAP-FILENAME.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
DATA: T_FILE_IN TYPE FILETABLE,
W_FILE_IN TYPE FILE_TABLE,
RC TYPE I.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
CHANGING
FILE_TABLE = T_FILE_IN
RC = RC
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
OTHERS = 4.
IF SY-SUBRC = 0.
CHECK RC = 1.
READ TABLE T_FILE_IN INTO W_FILE_IN INDEX 1.
MOVE W_FILE_IN TO P_FILE.
ENDIF.
Regards
Kiran Sure
‎2008 May 16 7:27 AM