on 03-10-2008 7:22 AM
Hello Frnds,
I am looking for ur dynamic Ideas.My requirement is...
As after awe all do entering the mandatory import parameters for FM and then we execute the function module or Bapi..we get a list of RESULTs..
But I would like to write a FM ,where the the user can specify the exact PARAMETERS OR FIELDS he would like to see....in the Export or i mean as a result from the FM
Pls help me in achieving this..
All ur efforts will be greatly respected..
thx,
RAM.
For this you can write a custom RFC which calls standard bapi inside... with this you will be able to write import and export parameters as per ur requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai....thx for the time...
yes.... but can u tell me in a bit detai..
i am thinking of assigning the standard bapi name as import parameter for the custom bapi and the export parameters will be varibles which will be passed by a external system...
but pls make me clear that how to do that first stpe calling standard bapi in inside the custom rfc
thx ram
Hi,
Say you want to check material existance for that you want to use your own parameres (import/Export) then u can use codes like this:
FUNCTION ZBAPI_MATERIAL_EXISTENCECHECK.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(ZMATERIAL) LIKE BAPIMATALL-MATERIAL
*" VALUE(ZMATERIAL_EVG) TYPE BAPIMGVMATNR
*" EXPORTING
*" VALUE(ZRETURN) LIKE BAPIRETURN1 STRUCTURE BAPIRETURN1
*"----------------------------------------------------------------------
CALL FUNCTION 'BAPI_MATERIAL_EXISTENCECHECK'
EXPORTING
material = zmaterial
* MATERIAL_EVG =
IMPORTING
* DELETION_FLAG =
RETURN = zreturn.
ENDFUNCTION.
in above example i created a custom RFC ZBAPI_MATERIAL_EXISTENCECHECK which call standard BAPI BAPI_MATERIAL_EXISTENCECHECK.
sorry for late response...
but dear friend....
my requirement says i have to enter the function name dynamically and enter the import and export parameters also dynamically...
so here the problem is ..sometime the particular filed of aprticular table is to mentioned..and the number of export parameters are also more ..
all this is making a big confusing..
Hi,
You can specify both the FM name and parameters dynamically:
TYPE-POOLS: abap.
DATA:
l_name TYPE string VALUE 'BAPI_MATERIAL_EXISTENCECHECK',
lt_par TYPE abap_func_parmbind_tab,
ls_par TYPE abap_func_parmbind,
ls_bapi TYPE bapireturn1,
l_matnr TYPE matnr VALUE 'MATNR1'.
ls_par-name = 'MATERIAL'.
ls_par-kind = abap_func_exporting.
GET REFERENCE OF l_matnr INTO ls_par-value.
INSERT ls_par INTO TABLE lt_par.
ls_par-name = 'RETURN'.
ls_par-kind = abap_func_importing.
GET REFERENCE OF ls_bapi INTO ls_par-value.
INSERT ls_par INTO TABLE lt_par.
CALL FUNCTION l_name
PARAMETER-TABLE
lt_par.
Regards,
Jakub
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.