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 PROBLEM

Former Member
0 Likes
1,090

Hi experts,

I am using this standard BAPI but it won't work and show a error .

ERROR -: ''=.." expected after "if".

plz solve my problem

REGARDS,

skmohanty.

&----


*& Report ZDEMO_BAPI_SALESGETSTATUS *

*& *

&----


*& *

*& *

&----


REPORT ZDEMO_BAPI_SALESGETSTATUS .

PARAMETERS : P_SDOCNO TYPE VBAK-VBELN.

DATA : WA_RETURN TYPE BAPIRETURN,

IT_STATUS TYPE TABLE OF BAPISDSTAT,

WA_STATUS TYPE BAPISDSTAT.

CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'

EXPORTING

SALESDOCUMENT = P_SDOCNO

IMPORTING

RETURN = WA_RETURN

TABLES

STATUSINFO = IT_STATUS

IF WA_RETURN IS INITIAL.

LOOP AT IT_STATUS INTO WA_STATUS.

WRITE :/5 WA_STATUS-DOC_NUMBER, WA_STATUS-DOC_DATE, WA_STATUS-PURCH_NO, WA_STATUS-PRC_STAT_H, WA_STATUS-DLV_STAT_H.

ENDLOOP.

ELSE

WRITE :/5 WA_RETURN-TYPE, WA_RETURN-CODE, WA_RETURN-MESSAGE.

ENDIF. .

1 ACCEPTED SOLUTION
Read only

mvoros
Active Contributor
0 Likes
1,034

Hi,

please check your program carefully. Your program is missing two ".". Every ABAP statement has to end with ".". In your case check statement CALL FUNCTION and ELSE.

Cheers

6 REPLIES 6
Read only

mvoros
Active Contributor
0 Likes
1,035

Hi,

please check your program carefully. Your program is missing two ".". Every ABAP statement has to end with ".". In your case check statement CALL FUNCTION and ELSE.

Cheers

Read only

nirajgadre
Active Contributor
0 Likes
1,034

Hi,

In you code the DOT(.) is missing after the function call so insert the '.'after the call function.

REPORT ZDEMO_BAPI_SALESGETSTATUS .

PARAMETERS : P_SDOCNO TYPE VBAK-VBELN.

DATA : WA_RETURN TYPE BAPIRETURN,

IT_STATUS TYPE TABLE OF BAPISDSTAT,

WA_STATUS TYPE BAPISDSTAT.

CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'

EXPORTING

SALESDOCUMENT = P_SDOCNO

IMPORTING

RETURN = WA_RETURN

TABLES

STATUSINFO = IT_STATUS

Insert DOT here.

IF WA_RETURN IS INITIAL.

LOOP AT IT_STATUS INTO WA_STATUS.

WRITE :/5 WA_STATUS-DOC_NUMBER, WA_STATUS-DOC_DATE, WA_STATUS-PURCH_NO, WA_STATUS-PRC_STAT_H, WA_STATUS-DLV_STAT_H.

ENDLOOP.

after ELSE also put the dot

ELSE

WRITE :/5 WA_RETURN-TYPE, WA_RETURN-CODE, WA_RETURN-MESSAGE.

ENDIF. .

Read only

Former Member
0 Likes
1,034

Hi all,

still it won't work and show same error.

Plz solve it bcoz i am new in ABAP.

Regards,

skmohanty.

Read only

0 Likes
1,034

>

> Hi Mohanty,

> Your code is working fine , only error is you hav not kept the periods .

> correctly , which has been clearly indicated in the previous posts.

> i have corrected your code and pasted it here you can try now

> Regards,

> .

>

PARAMETERS : P_SDOCNO TYPE VBAK-VBELN.

DATA : WA_RETURN TYPE BAPIRETURN,

IT_STATUS TYPE TABLE OF BAPISDSTAT,

WA_STATUS TYPE BAPISDSTAT.

CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'

EXPORTING

SALESDOCUMENT = P_SDOCNO

IMPORTING

RETURN = WA_RETURN

TABLES

STATUSINFO = IT_STATUS.

IF WA_RETURN IS INITIAL.

LOOP AT IT_STATUS INTO WA_STATUS.

WRITE :/5 WA_STATUS-DOC_NUMBER, WA_STATUS-DOC_DATE, WA_STATUS-PURCH_NO, WA_STATUS-PRC_STAT_H, WA_STATUS-DLV_STAT_H.

ENDLOOP.

ELSE.

WRITE :/5 WA_RETURN-TYPE, WA_RETURN-CODE, WA_RETURN-MESSAGE.

ENDIF.

>

Edited by: gurunath pandiyarajan on Feb 5, 2010 5:31 AM

Read only

0 Likes
1,034

HI,

I got my output.

THANKS,

skmohanty.

Read only

Former Member
0 Likes
1,034

THANKS