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

how to use parameter id in bdcprogram

Former Member
0 Likes
1,345

Hi experts,

I want to do recording for  FMBB tcode.The problem is for header part there is screen-field,program,screen number are availabe.For item part

there is no screen number,screen-field.I am giving example also.

HEADER

screen field: FMBW_S_SCREEN-PROCESS_UI

program name: SAPLFMBWB

screen number: 0001

ITEM

screen field: no field

screen number: no screen number

1) How to do recording in this scenario.

2) There is parameter id for the item fields.I do not how to use parameter ids in bdc recording.

Please giude me guys how to do bdc recording for FMBB.

Thanks,

Maharana

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,077

I will suggest you to use function BAPI_0050_CREATE / BAPI_0050_REVERSE

to avoid such complications. Its documented.

8 REPLIES 8
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,078

I will suggest you to use function BAPI_0050_CREATE / BAPI_0050_REVERSE

to avoid such complications. Its documented.

Read only

0 Likes
1,077

Hi kesav,

Thanks for qiuck reply.Actually i have used FM FMKU_0050_CREATE_WITH_COMMIT.

I am passing summed values to the FM.But the value is updated in first period only that is HSL01

field only.

To elaborate more precisely,my requirement is to update FMAVCT table periodwise.For this i created one zreport having selection screen company code,fiscal year,period.If the period on selectionscreen

is 3 then i am summing period 1,2,3 and passing data to FM FMKU_0050_CREATE_WITH_COMMIT.

But the funny thing is FM is updating the value in 1 period only. BAPI_0050_CREATE and FMKU_0050_CREAT are called in FMKU_0050_CREATE_WITH_COMMIT.

so my understanding is either i would copy FMKU_0050_CREAT or BAPI_0050_CREATE into ZFuncmodules or i have to BDC recording.for bdc i am not gettting screen number and screen fields for item fields.for Zfunctmodules i do not know whether is going to affect any standard table other than FMAVCT table.

so what yo do ....

Read only

0 Likes
1,077

"is 3 then i am summing period 1,2,3 and passing data to FM FMKU_0050_CREATE_WITH_COMMIT.

But the funny thing is FM is updating the value in 1 period only"

How ae you populating the parameter PERIOD_DATA in this case ?

Read only

0 Likes
1,077

I am giving the code which i am using.

data : FMAREA TYPE  BAPI_0050_FIELDS-FM_AREA,
DOCUMENTYEAR  TYPE  BAPI_0050_FIELDS-DOC_YEAR,
DOCUMENTNUMBER  TYPE  BAPI_0050_FIELDS-DOCUMENT,
testrun type  bapi_0050_fields-testrun,

IT_RETURN TYPE STANDARD TABLE OF BAPIRET2,
WA_RETURN TYPE BAPIRET2,

IT_HEADDATA TYPE STANDARD TABLE OF BAPI_0050_HEADER,
WA_HEADDATA TYPE BAPI_0050_HEADER,

IT_ITEMDATA TYPE STANDARD TABLE OF BAPI_0050_ITEM,
WA_ITEMDATA TYPE BAPI_0050_ITEM,

it_PERIOD_DATA type standard table of BAPI_0050_PERIOD,
wa_PERIOD_DATA type BAPI_0050_PERIOD.

WA_HEADDATA-FM_AREA = 'CPIL'.
WA_HEADDATA-VERSION = '000'.
WA_HEADDATA-DOCDATE = sy-datum.
WA_HEADDATA-DOCTYPE = '0001'.
WA_HEADDATA-DOCSTATE = '1'.
WA_HEADDATA-PROCESS = 'ENTR'.
APPEND WA_HEADDATA TO IT_HEADDATA.


WA_ITEMDATA-MEASURE = MEASURE.          "  FUNDED PROGRAMME
WA_ITEMDATA-TRANS_CURR = 'INR'.
WA_ITEMDATA-TOTAL_AMOUNT = wa_fag1-hsl01.
WA_ITEMDATA-ITEM_NUM = v_tabix.
WA_ITEMDATA-FISC_YEAR = year.
WA_ITEMDATA-BUDCAT = '9F'.
WA_ITEMDATA-BUDTYPE = 'TEST'.
WA_ITEMDATA-FUND = 'EXP'.
WA_ITEMDATA-DISTKEY = '0'.
WA_ITEMDATA-VALTYPE = 'B1'.
APPEND WA_ITEMDATA TO IT_ITEMDATA.

BUDGETING_PERIOD = period.

" fetthing period data
wa_PERIOD_DATA-ITEM_NUM = lin + 1 .
wa_PERIOD_DATA-BUDGETING_PERIOD = BUDGETING_PERIOD.
append wa_PERIOD_DATA to it_PERIOD_DATA.

CALL FUNCTION 'FMKU_0050_CREATE_WITH_COMMIT'
  EXPORTING
   LANGUAGE                 = 'E'
    header_data              = WA_HEADDATA
   TESTRUN                  = testrun

IMPORTING
   FMAREA                   = FMAREA
   DOCUMENTYEAR             = DOCUMENTYEAR
   DOCUMENTNUMBER           = DOCUMENTNUMBER
  tables
    item_data                = IT_ITEMDATA[]
*   SENDER_ITEM_DATA         =
   PERIOD_DATA              = it_PERIOD_DATA[]
*   SENDER_PERIOD_DATA       =
*   LONG_TEXT                =
*   EXTENSION_IN             =
    return                   = IT_RETURN[]
          .

Read only

0 Likes
1,077

What is your business condition, you are summing up the periods and then ?

Should it be saved to each item ?

I do not see any loops for the period table, hence one item is updated. Also the item no used in item details & period table are different.

Read only

0 Likes
1,077

I am sending the amount value to

WA_ITEMDATA-TOTAL_AMOUNT = wa_fag1-hsl01.

i am testing only for one item.so no loop is needed. I am also passing selectionscreen period value to

  BUDGETING_PERIOD = period."""""selection-screen period value

" fetthing period data
wa_PERIOD_DATA-ITEM_NUM = lin + 1 .
wa_PERIOD_DATA-BUDGETING_PERIOD = BUDGETING_PERIOD.
append wa_PERIOD_DATA to it_PERIOD_DATA.

i am getting period as the selection screen value in it_PERIOD_DATA.but i could not understand why the fm is updating in first period only.

Read only

Former Member
0 Likes
1,077

We can set parameter ID's using the ABAP command SET PARAMETER ID ' '.

SET PARAMETER ID pid FIELD dobj.

pid = Parameter ID

dobj = field holding the value for the parameter.

Please revert back in case you need more help.

Read only

Former Member
0 Likes
1,077