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

Web Dynpro with BAPI

Former Member
0 Likes
1,542

Hi everyone,

I am trying to learn Web Dynpro, can you please give me a good example of how to create a Web Dynpro application using a BAPI. let's say a BAPI to display the customer records, for example the user should be able to enter the customer number and get his details.

Any help will be appreciated.

Thanks,

Rajat

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,484

Please check this page. Tutorial 2 is about BAPI usage.

[original link is broken]

Regards,

Rich Heilman

14 REPLIES 14
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,485

Please check this page. Tutorial 2 is about BAPI usage.

[original link is broken]

Regards,

Rich Heilman

Read only

0 Likes
1,484

Thanks for the reply Rich I followed the tutorial and created the web application and everything looked perfect except when I am entering the from and to City details and clicking on get flight details button I am not getting any result. Can you please help me in this.

Thanks,

Rajat

Read only

0 Likes
1,484

Make sure that the values that you are entering are valid in the DB.

Regards,

Rich Heilman

Read only

0 Likes
1,484

Thanks for the quick reply Rich... I just looked the table that we are using in the BAPI and found that there is noithing in there.

Read only

0 Likes
1,484

In that case, you need to generate some data in the flight model database. Use program SAPBC_DATA_GENERATOR to generate this data. Once that is done, re-run your WD application, and it should work.

Regards,

Rich Heilman

Read only

0 Likes
1,484

Thanks for the reply Rich, I created couple of more web applications !! one for displaying the vendor details, i.e. enter the vendor number and you will get the details, and this one is working fine. Now i tried to create an application for displaying the invoice header details by entering the document number using BAPI "BAPI_INCOMINGINVOICE_GETDETAIL". but when I test it i get the screen where i Need to enter the invoice number, as soon as I enter the Invoice numbr and hit enter I am getting following errors.

The following error text was processed in the system RS2 : Incorrect parameter with CALL FUNCTION.

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: EXECUTE_BAPI_INCOMINGINVOICE_G of program /1BCWDY/GZZAZ6OOVDTOY53TTZ5Y==CP

Method: IF_COMPONENTCONTROLLER~EXECUTE_BAPI_INCOMINGINVOICE_G of program /1BCWDY/GZZAZ6OOVDTOY53TTZ5Y==CP

Method: ONACTIONGET_INVOICE_DETAILS of program /1BCWDY/GZZAZ6OOVDTOY53TTZ5Y==CP

Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/GZZAZ6OOVDTOY53TTZ5Y==CP

Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP

Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP

Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP

Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP

Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP

Can you please help me with this.

Read only

0 Likes
1,484

Check transaction ST22 for corresponding ABAP dump. This should tell you what the issue is.

Regards,

Rich Heilman

Read only

0 Likes
1,484

Hi Rich,

I already did it and I found that I have commented Return parameter while calling the BAPI, Ijust uncommented that and I am getting this error now "RETURN" is not an internal table. I am looking into this.

Thanks,

Raj

Read only

0 Likes
1,484

Hi Rich,

I uncommented the retrun parameter but now I am getting this error:

"RETURN" is not an internal table "OCCURS n" specification is missing.

In the attributes I have declared this Attribute as:

Return with associated type BAPIRET2.

can you please see what am I doing wrong.

Read only

0 Likes
1,484

the return parameter should be type as an internal table. Basic ABAP skills are required to complete these tutorials successfully.

data: bapi_return type table of BAPIRET2.

Regards,

Rich Heilman

Read only

0 Likes
1,484

Hi Rich,

I have already tried doing this and I m still gettig the same message:

That's how my code looks like:

DATA: return type table of BAPIRET2.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_GETDETAIL'

EXPORTING

INVOICEDOCNUMBER = LV_INVOICEDOCNUMBER

FISCALYEAR = LV_FISCALYEAR

IMPORTING

HEADERDATA = LS_C_HEADERDATA

ADDRESSDATA = LS_C_ADDRESSDATA

TABLES

ITEMDATA = LT_C_ITEMDATA

" accountingdata =

" glaccountdata =

" materialdata =

" taxdata =

" withtaxdata =

" vendoritemsplitdata =

RETURN = WD_THIS->RETURN

" extensionout =

and when I double clicked on the "RETURN" its taking me to the attribute section, where Attribute "Return" has been declared as Ref to BAPIRET2

Read only

0 Likes
1,484

Yes, try it without the WD_THIS reference, and add a period at the end of it.

DATA: return type table of BAPIRET2.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_GETDETAIL'
EXPORTING
INVOICEDOCNUMBER = LV_INVOICEDOCNUMBER
FISCALYEAR = LV_FISCALYEAR
IMPORTING
HEADERDATA = LS_C_HEADERDATA
ADDRESSDATA = LS_C_ADDRESSDATA
TABLES
ITEMDATA = LT_C_ITEMDATA
" accountingdata =
" glaccountdata =
" materialdata =
" taxdata =
" withtaxdata =
" vendoritemsplitdata =
RETURN = RETURN.  "<---  just use RETURN here, and add a period 
" extensionout =

Regards,

Rich Heilman

Read only

0 Likes
1,484

Hi Rich,

Before you answered I changed my code.... and put return there but thanks a lot for your help !!!

Read only

0 Likes
1,484

Very good. If your issues are resolved, please close the thread. Thanks.

Regards,

Rich Heilman