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

Regarding Material extension - Upload through excel

Former Member
0 Likes
1,046

Dear Experts,

I'm new to abap .Request all your help in solving for material extension for different plant and different storage location by using Bapi 'BAPI_MATERIAL_SAVEDATA'.

Requirement  : Upload program needs to be created for material extension by uploading excel file . Request to share the correct coding.

Coding i was trying to do is as below and while checking i got the errror : " Statement is not accessible"

REPORT  ZPP_MAT_EXT.

tables : BAPIMATHEAD.

data : BEGIN OF itab occurs 0,
...


PARAMETERS: p_file type RLGRAP-filename.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
perform get_f4_help.

START-OF-SELECTION.
   perform upload_file.
   perform call_bapi.

FORM GET_F4_HELP .
...
ENDFORM.                    " GET_F4_HELP

data : v_file type string.
MOVE p_file TO v_file.

CALL FUNCTION 'GUI_UPLOAD'       -----> Error : " " Statement is not accessible"
   EXPORTING
     FILENAME                      = p_file
...

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT          = 2.
* IMPORTING
*   RETURN        =

Message was edited by: Matthew Billingham - to make it pretty obvious what the error is

Dear Experts,

I'm new to abap .Request all your help in solving for material extension for different plant and different storage location by using Bapi 'BAPI_MATERIAL_SAVEDATA'.

Requirement  : Upload program needs to be created for material extension by uploading excel file . Request to share the correct coding.

Coding i was trying to do is as below and while checking i got the errror : " Statement is not accessible"

REPORT  ZPP_MAT_EXT.

tables : BAPIMATHEAD.

data : BEGIN OF itab occurs 0,
...


PARAMETERS: p_file type RLGRAP-filename.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
perform get_f4_help.

START-OF-SELECTION.
   perform upload_file.
   perform call_bapi.

FORM GET_F4_HELP .
...
ENDFORM.                    " GET_F4_HELP

data : v_file type string.
MOVE p_file TO v_file.

CALL FUNCTION 'GUI_UPLOAD'       -----> Error : " " Statement is not accessible"
   EXPORTING
     FILENAME                      = p_file
...

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    WAIT          = 2.
* IMPORTING
*   RETURN        =

Message was edited by: Matthew Billingham - to make it pretty obvious what the error is

7 REPLIES 7
Read only

FredericGirod
Active Contributor
0 Likes
994

Hi,

your BAPI call is not inside a routine (FORM / ENDFORM)

regards

Fred

Read only

0 Likes
994

Dear Fred,

After calling bapi inside the routine also the same error is displaying.

Best rgds/thnks,

Srikanth.

Read only

0 Likes
994

do you have put your BAPI COMMIT also ?


Read only

0 Likes
994

yes i've put bapi commit also. Request to share the coding for the material master extension through BAPI , if any..

Best rgds/thnks,
Srikanth.

Read only

0 Likes
994

Hi Srikanth,

Please Check the attachment and execute the code .

Regards,

Pavan

Read only

0 Likes
994

Dear Pavan,

Thanks for sharing the code. Will try and revert.

Best rgds/thnks,
Srikanth.

Read only

matt
Active Contributor
0 Likes
994

I've edited your post to make it clear what the issue is. You have ABAP code after the FORM... ENDFORM. It will never be run.

Since this is so darned obvious, I've marked your question as a discussion.