cancel
Showing results for 
Search instead for 
Did you mean: 

Passing changing parameter to Bapis

Former Member
0 Kudos

Hi ,

I call the bapi "BAPI_BUS177_CREATE" wich need few importing and changing parameters.

In my view, i bind a table to changing parameter. But i can't modify any fields of the table.

I checked if table fields' are in "read-only" but that was not the case and i changed them from text fields to input fields in the binding process but it doesn't help. I can put nothing in these fields.

Any help to pass changing parameter to "BAPI_BUS177_CREATE" when calling it.

Thanks in advance.

Azmi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Nobody here knows how to pass changing parameters when calling a bapi in web dynpro ?

Experts i need your help please.

Thanks

Former Member
0 Kudos

Hi,

Are you using service call to call that BAPI or using CALL FUNCTION.

If you are using service call just bind your changing parameter of BAPI to Table UI element.

If you are using CALL Function.. check below example code..

data : del_tab type STANDARD TABLE OF BAPIDLVREFTOSALESORDER.

data: wa_tab type BAPIDLVREFTOSALESORDER.

data : del type BAPISHPDELIVNUMB-DELIV_NUMB.

LOOP AT IT_VBAP INTO WA_VBAP.

WA_TAB-REF_DOC = WA_VBAP-VBELN.

WA_TAB-REF_ITEM = WA_VBAP-POSNR.

WA_TAB-DLV_QTY = WA_VBAP-KWMENG.

WA_TAB-SALES_UNIT = WA_VBAP-VRKME.

append WA_TAB to DEL_TAB.

ENDLOOP.

CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_SLS'

EXPORTING

SHIP_POINT = lv_ship_point

DUE_DATE = lv_ledat

IMPORTING

DELIVERY = del

TABLES

SALES_ORDER_ITEMS = del_tab // This is Changing or Table paramer

RETURN = bapi_return.

Hope it helps..

Cheers,

Kris.

Edited by: kissnas on Mar 29, 2011 11:10 AM

former_member184578
Active Contributor
0 Kudos

Hi dyngry,

May be those changing parameter is updating but as u binded the initial values to table it is not showing the changes., Once u call the BAPI pls re-bind the changing parameter to table UI. U can also put break point and check the changing parameter values.,

Thanks & Regards

Kiran

Former Member
0 Kudos

Hi Kris,

I use a service call to call the Bapi.

But how does i have to do if i don't need to show some fields in my view and to fill in them with internal values from data base or any other sources.

And i have also another problem. The changing parameter must be binded to a table. And in my view i can't change the blank values of the table's fields. So i have error when i call the bapi telling that there is a mandatory table missing.

Thanks.

Former Member
0 Kudos

Hi,

If you don't want to display some fields means, dont display those fields. Try like this..

Right click on TABLE UI Element (right side under root element ) - u find create binding option, click on that.

It display all attributes with binding, just remove binding un wanted fields and save. Also remove those columns from table also.

Cheers,

Kris.

Former Member
0 Kudos

Hi

thanks for your response, but it doesn't help me.

I need to know how can i assign value for unselected fields.

And in wich level or method , does i have to do it ?

Thanks

Former Member
0 Kudos

Hi,

I am not getting what is your requirement exactly please expalin??

You want to pass some data to FM?? if yes..

Use CALL FUNCTION .. follow my previous post, here pass data whatever you want and append table.

Pass that table to tables parameter.

Cheers,

Kris.

Former Member
0 Kudos

Ok i will explain you what i have to do.

I have to use "BAPI_BUS1077_CREATE" to create a view with a form to permit to a user to create a substance.

My problem is when i bind "SUB_HEADER" wich is a CHANGING sub-node. it obliges me to use a table so i can't fill-in fields

and i haven't the form requested.

A workmate suggests me to create another structure wich has cardinality 1..1 in my view context. So i can use a simple form. and after to bind it to the original one.

I block in the last step now.

I follow this example "http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/populate_field.htm " to do it but it dosen't work.

hopefully it's clearer.

gill367
Active Contributor
0 Kudos

Create a node sub_header in view with cardinality 1..1 then

map the attributes of this node to the UI elements of the form.

then read the node's element into an internal table after filling the values and bind the internal table to the node mapped to

serivce controller.

here is the sample code


 DATA lo_nd_sub_header_1 TYPE REF TO if_wd_context_node.
    DATA lo_el_sub_header_1 TYPE REF TO if_wd_context_element.
    DATA lt_sub_header_1 TYPE wd_this->elements_sub_header_1.
*   navigate from <CONTEXT> to <SUB_HEADER_1> via lead selection
    lo_nd_sub_header_1 = wd_context->get_child_node( name = wd_this->wdctx_sub_header_1 ).



*   get all declared attributes
   lo_nd_sub_header_1->GET_STATIC_ATTRIBUTES_TABLe(
      IMPORTING
        TABLE = lt_sub_header_1 ).

       DATA lo_nd_bapi_bus1077_create TYPE REF TO if_wd_context_node.
       DATA lo_nd_changing TYPE REF TO if_wd_context_node.
       DATA lo_nd_sub_header TYPE REF TO if_wd_context_node.


       lo_nd_bapi_bus1077_create = wd_context->get_child_node( name = wd_this->wdctx_bapi_bus1077_create ).


       lo_nd_changing = lo_nd_bapi_bus1077_create->get_child_node( name = wd_this->wdctx_changing ).

       lo_nd_sub_header = lo_nd_changing->get_child_node( name = wd_this->wdctx_sub_header ).

       lo_nd_sub_header->bind_table(
       lt_sub_header_1
        ).



thanks

sarbjeet singh

Former Member
0 Kudos

Thanks for your reponse,

I have already find the solution yesterday night.

Here is the code. it is very similar to yours.

DATA: lo_node_1 TYPE REF TO if_wd_context_node.
 DATA: lo_node_2 TYPE REF TO if_wd_context_node.
 DATA: lo_node_3 TYPE REF TO if_wd_context_node.
 DATA: wa_line type BAPI1077RH.

*----------------------------------------------------
** assign right flags (importing parameters)
*----------------------------------------------------

lo_node_3 = wd_context->get_child_node( name = 'IMPORTING' ).
lo_node_3->SET_ATTRIBUTE( exporting NAME = 'FLG_HEADER'
                                  value = 'X' ).


*----------------------------------------------------
** copy fields' values in wa_line
*----------------------------------------------------
lo_node_2 = wd_context->get_child_node( name = 'BAPI1077RH' ).

lo_node_2->GET_ATTRIBUTE( exporting NAME = 'CREATED_ON'
                                 importing value = wa_line-CREATED_ON ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'CREATED_BY'
                                 importing value = wa_line-CREATED_BY ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'DATAORIGIN'
                                 importing value = wa_line-DATAORIGIN ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'DATA_PROV'
                                 importing value = wa_line-DATA_PROV ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'SUBSTANCE'
                                 importing value = wa_line-SUBSTANCE ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'SUBCATEGRY'
                                 importing value = wa_line-SUBCATEGRY ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'SUBAUTHGRP'
                                 importing value = wa_line-SUBAUTHGRP ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'NOTE'
                                 importing value = wa_line-NOTE ).
lo_node_2->GET_ATTRIBUTE( exporting NAME = 'SUBCHARACT'
                                 importing value = wa_line-SUBCHARACT ).

*----------------------------------------------------
** bind in local wa_line to the context
*----------------------------------------------------
lo_node_1 = wd_context->get_child_node( name = 'SUB_HEADER' ).
lo_node_1->BIND_STRUCTURE( wa_line ).

DATA lo_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER .
lo_COMPONENTCONTROLLER =   wd_this->get_componentcontroller_ctr( ).

  lo_componentcontroller->execute_bapi_bus1077_create(
  ).

Hopefully that it can help someone else.

Answers (0)