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

BAPI_PO_CREATE1

Former Member
0 Likes
701

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 *

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
667

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

5 REPLIES 5
Read only

Sm1tje
Active Contributor
0 Likes
667

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

Read only

Former Member
0 Likes
667

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

Read only

Former Member
0 Likes
667

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

Read only

Former Member
0 Likes
668

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

Read only

Former Member
0 Likes
667

my question is not completely answered