cancel
Showing results for 
Search instead for 
Did you mean: 

Passing input enabled table to a bapi.

Former Member
0 Kudos

Hi.

I created an input enabled table in which the user enters the data. On the click "send", the data in the table should be sent as exporting parameter ( which is of type table).

I tried to read the context of the table as

lo_el_directive_pos_ipf->get_static_attributes(

IMPORTING

static_attributes = ls_directive_pos_ipf ).

and tried to assign..but it is not working.

How should i pass the table to the bapi.

Plz help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi bichoo.......

your bapi might be requiring a table as an input... say the structure of the table is itab....

but you have an input field which has to be passed to this table...say itab-field...

what you can do is ....

read the input field...

let the variable be var1...

now have an internal table that has the same structure of the bapi table..... let it bei tab1...

so wa-field = var1.

append wa to itab1...

now pass this itab to the bapi.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex..

This is what i did. The table which the bapi needs is suppose of type "TAB_ORG". So i created an internal table say "TAB_TEMP" with work area as :

DATA : TAB_TEMP LIKE TAB_ORG,

WA LIKE LINE OF TAB_TEMP.

Then i read the column of the tree using wizard and then pass it to work area as:

wa-field = "value read by wizard".

Finally i append wa to TAB_TEMP.

Then i pass this "TAB_TEMP" to the bapi.. but when i run it ..it gives the error

"Type conflict when calling a function module"

Can u plz help

Former Member
0 Kudos

hi bichoo...........

give tab_temp type standard table of tab_org.

---regards,

alex b justin

Madhu2004
Active Contributor
0 Kudos

Hi,

I think u can use this method to read the entries in the table :

NODE->GET_STATIC_ATTRIBUTES_TABLE

and after this u get the table output and pass this to the bapi. Check if the structure of ur table and the importing paramnater of the bapi are same.

regards,

madhu

Former Member
0 Kudos

Hi Alex...

Thanks it is working now.. but the problem which now i am facing is that only one row of the table is passed to the bapi.I want to read all the rows of the table and then want to pass it.How can it be done?

Former Member
0 Kudos

hi bichoo.....

if you need to pass a table... then you should have a table ui element and do so...

or

you could have 3 or 4 input fieldas of the same type bound to different attributes and then read it one by one... append it to the same internal table and tehn pass it to the bapi.

---regards,

alex b justin

Former Member
0 Kudos

That is what i am trying to do.Here is what i have done..

I am reading the attributes of the table using get attribute . After reading all the attributes, i am appending them to an internal table which is passed to the bapi.. But even if i loop it many times also, it always reads the value of the first row only..Here is what i have done

do 3 times.

...

..

read the atrributes of column

..

..

Append to itab.

enddo.

What should i do so that it reads the next column when the do loop is called again???

Former Member
0 Kudos

hi bichoo....

if you are going to use a table.. then you should

not use get_static_attributes...

for it will always return the first row

you should use

get_static_attributes_table...

which will return all the values of the table to the internal table that you pass...

you no need to append.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex..

I am not using "get_static_attributes" but i am using only "get_attribute", i.e., i am reading column by column. I didn't get how i will implement " get_static_attributes_table"...

Former Member
0 Kudos

hi bichoo......

for your convenience:

click code wizard... and read the node that is bound to the table.....

you will be having a reference to if_wd_context_node...

and a method that calss get_static_attributes...

now instead of that method give get_static_attributes_table...

and within the brackets give the internal table name....

all teh values will be transfered to the internal table and then you can process it and pass it to the bapi.

---regards,

alex b justin

Former Member
0 Kudos

I tried it.. It is giving the error:

Method "GET_STATIC_ATTRIBUTES_TABLE" is unknown or PROTECTED, PACKAGE or PRIVATE.

Former Member
0 Kudos

hi bichoo.......

this is a sample coding:



     DATA lo_nd_po TYPE REF TO if_wd_context_node.
     DATA lo_el_po TYPE REF TO if_wd_context_element.
     DATA ls_po TYPE wd_this->element_po.
     
     data itab type standard table of ekko.
     
*    navigate from <CONTEXT> to <PO> via lead selection
     lo_nd_po = wd_context->get_child_node( name = wd_this->wdctx_po ).

*    get element via lead selection
     lo_el_po = lo_nd_po->get_element(  ).

     lo_el_po->get_static_attributes_table(
       IMPORTING
        table = itab ).

.

here lo_nd_po refers to the context node

lo_el_po refers to the child node thta is bound to the table..

---regards,

alex b justin

Former Member
0 Kudos

Hi Bichoo,

The method GET_STATIC_ATTRIBUTES_TABLE is from the interface if_wd_context_node, not if_wd_context_element.

Therefore, if you try

lo_nd_po->get_static_attributes_table(

IMPORTING

table = itab ).

it might work out.

regards,

Lloyd

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Muzammil,

to read all context elements, we can use method

IF_WD_CONTEXT_NODE->GET_STATIC_ATTRIBUTES_TABLE( )

Silke