Application Development 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: 

Facing problem in return

Former Member
0 Kudos

Hello;

I ahve created the simple BAPI with some constant data but when i execute this bapi my internal shows 0 entries...pls throw some light on this

FUNCTION BAPI_SF_OMKAR.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(MANDT) TYPE SFLIGHT-MANDT

*" VALUE(CARRID) TYPE SFLIGHT-CARRID

*" VALUE(SEATSMAX) TYPE SFLIGHT-SEATSMAX

*" VALUE(SEATSOCC) TYPE SFLIGHT-SEATSOCC

*" VALUE(CURRENCY) TYPE SFLIGHT-CURRENCY

*" EXPORTING

*" VALUE(RETURN) TYPE BAPIRET2

*" TABLES

*" ITAB STRUCTURE ZSFOM

*"----


If carrid is initial.

RETURN-type = 'E'.

RETURN-message = 'Carrid is Null ,enter valid carrid'.

endif.

CONSTANTS: BEGIN OF sampledata,

CARRID TYPE c LENGTH 3 VALUE 'AA',

SEATSMAX TYPE i value '200',

SEATSOCC TYPE i value '100',

currency TYPE c LENGTH 3 VALUE 'USD'.

.

CONSTANTS end OF sampledata.

SELECT MANDT CARRID SEATSMAX SEATSOCC CURRENCY FROM SFLIGHT INTO TABLE ITAB where carrid = 'AA'.

IF sy-subrc ne 0 or ITAB[] is initial.

RETURN-type = 'E'.

RETURN-message = 'DATA found for selection'.

endif.

ENDFUNCTION.

Moderator message: Omkar, no matter how many IDs you are using, all threads of this kind will be locked, the IDs deleted, and we will look into further options if we are forced to. Stop it now!

locked by: Thomas Zloch on Oct 6, 2010 3:33 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Are you getting any records in return table.

Thanks,

Anmol.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Are you getting any records in return table.

Thanks,

Anmol.

0 Kudos

No..Thats where I am facing problem..whta is going wrong..

0 Kudos

Hi,

I tried your code, it is fetching data for me, check your sflight table any entries for 'AA' and have some questions for your code, why you use constant what is the use of tht, again if you are hardcodding where carrid then why you are importing carrid and other data, just curious.

Thanks,

Anmol.