Application Development 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: 

BAPI to Post MIGO deatils with Excise Deatils

aromalr
Active Participant
0 Kudos

Is there any BAPI in SAP which can do both Goods Movement (101 ) and posting of Excise details.?

BAPI_GOODS_MOVEMENT_CREATE. doesn't have excise details.

21 REPLIES 21

Former Member
0 Kudos

You may like to explore FM j_1iexgm_update_excise for excise update.

0 Kudos

I Checked the FM, Its Table Parameteres are MKPF & MSEG. Its a Material Document Header and Item values.

So you mean to say I need to call goods movement first and then call j_1iexgm_update_excise ?

0 Kudos

resolved by myself

0 Kudos

Hi Boss,

i want to do the same scenario. can you send the logic ? please

Regards,

Ram

0 Kudos

Hi Aromal,

          I too have a similar requirement to update the excise details after GR. Please can you tell how
you have done this.

Thanks in advance,

Priya

0 Kudos

Hi Priya,

I have used the goods movement BAPI along with BDC recording for the transaction J1IEX_C.

Regards

Aromal R

0 Kudos


Hi Aromal,

        Thanks for your reply. In my Z program I am entering Excise Inv no(EXNUM) and date(EXDAT) as Excise related data along with other GR Data in the selection screen. Do you know whether we can update the excise details with any FM? I had tried using FM 'BAPI_EXCINV_CREATE_FROMDATA' but this was updating the excise details related to sales but I need to update the excise details related to purchase. Since I am new to BDC, please if you don't mind can you provide the screenshots or methods to create BDC recording for the transaction J1IEX_C.

Thanks & Regards,

Priya

0 Kudos

Hi Priya,

There are lot of documents available on internet for BDC tutorial. This transaction involves BDC with table control, which is bit tricky. I am pasting sample code for your reference. Don't copy paste the same code it might not work because the screen configuration may vary system to system.

DATA: l_mstring(480).



DATA: count TYPE n LENGTH 2 VALUE '01'.
DATA: wrk_txt TYPE char21.
DATAf_option         TYPE ctu_params.
DATAitab_bdcmsgcoll TYPE bdcmsgcoll OCCURS 0.
DATAwa_msgs TYPE   bdcmsgcoll.

f_option
-updmode  = 'L'.
f_option
-defsize  'X'.
f_option
-dismode  = 'A'.

*  BREAK-POINT.
LOOP AT it_data INTO wa_data.

wa_mac
-mblnr    = wrk_matdocu.
wa_mac
-mjahr    = wrk_matyear.
wa_mac
-exnum    = wa_data-exnum.
wa_mac
-exdat    = wa_data-exdat.
*    wa_mac-posnr    = wa_data-posnr.
*    wa_mac-exbas    = wa_data-exbas.
wa_mac
-exbed    = wa_data-exbed.
wa_mac
-ecs      = wa_data-ecs.
wa_mac
-exaddtax1 = wa_data-exaddtax1.
wa_mac
-exaed = wa_data-exaed.
APPEND wa_mac TO   it_mac.
ENDLOOP.

it_mac_copy[]
= it_mac[].
SORT it_mac BY mblnr.
DELETE ADJACENT DUPLICATES FROM it_mac COMPARING mblnr.

LOOP AT it_mac INTO wa_mac.

PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=J1IEX_OK_GO'.
PERFORM bdc_field       USING 'J_1IEXDYNPRO-ACTION'
'A01'.
PERFORM bdc_field       USING 'J_1IEXDYNPRO-REFDOC'
'R05'.
PERFORM bdc_field       USING 'BDC_CURSOR'
'J_1IEXDYNPRO-MAT_DOC'.
PERFORM bdc_field       USING 'J_1IEXDYNPRO-MAT_DOC'
wa_mac
-mblnr.



*                                  wa_mac-mblnr.
PERFORM bdc_field       USING 'BDC_CURSOR'
'J_1IEXDYNPRO-MAT_DOC_YEAR'.
PERFORM bdc_field       USING 'J_1IEXDYNPRO-MAT_DOC_YEAR'
wa_mac
-mjahr.


*    PERFORM bdc_field       USING 'J_1IEXDYNPRO-DETAIL_ZEILE'
*                                  '   1'.
*    PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
*    PERFORM bdc_field       USING 'BDC_OKCODE'
*                                  '=OK_GO'.
PERFORM bdc_field       USING 'BDC_CURSOR'
'J_1IEXHEAD-EXDAT'.
PERFORM bdc_field       USING 'J_1IEXHEAD-EXNUM'
wa_mac
-exnum.
PERFORM bdc_field       USING 'J_1IEXHEAD-EXDAT'
wa_mac
-exdat.


LOOP AT it_mac_copy INTO wa_mac_copy WHERE mblnr = wa_mac-mblnr.


IF count GT '2'.
PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=P+'.

count = 1.
ENDIF.
CLEAR wrk_txt .



CONCATENATE 'J_1IEXITEM-ZEILE(' count ')' INTO wrk_txt .
PERFORM bdc_field       USING 'BDC_CURSOR'
wrk_txt
.

PERFORM bdc_field       USING 'J_1IEXDYNPRO-DETAIL_ZEILE'
wrk_txt
.

PERFORM bdc_field       USING 'J_1IEXDYNPRO-DETAIL_ZEILE'
wrk_txt
.
PERFORM bdc_field       USING 'J_1IEXDYNPRO-DETAIL_TAKE'
'X'.

PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=J1IEX_OK_LINE_CLICK'.

PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=OK_GO'.

PERFORM bdc_field       USING 'J_1IEXHEAD-EXNUM'
wa_mac
-exnum.
PERFORM bdc_field       USING 'J_1IEXHEAD-EXDAT'
wa_mac
-exdat.



*      PERFORM bdc_field       USING 'J_1IEXITEM-TOTAL_BED'
*                                     wrk_exbed.

PERFORM bdc_field       USING 'J_1IEXITEM-TOTAL_BED'

wa_mac_copy
-exbed.
PERFORM bdc_field       USING 'J_1IEXITEM-TOTAL_ECS'
wa_mac_copy
-ecs.
PERFORM bdc_field       USING 'J_1IEXITEM-TOTAL_AT1'
wa_mac_copy
-exaddtax1.
PERFORM bdc_field       USING 'J_1IEXITEM-TOTAL_AED'
wa_mac_copy
-exaed.


PERFORM bdc_field       USING 'J_1IEXDYNPRO-DETAIL_TAKE'
'X'.
PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=OK_GO'.
PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=J1IEX_OK_LINE_CLICK'.
count = count + 1.
ENDLOOP.

PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=OK_GO'.

PERFORM bdc_dynpro      USING 'SAPLJ1IEX' '0001'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=OK_CHECK'.
*    PERFORM bdc_transaction USING 'J1IEX_C'.
PERFORM bdc_field       USING 'BDC_OKCODE'
'=OK_POST'.
CALL TRANSACTION 'J1IEX_C' USING bdcdata
OPTIONS
FROM f_option
MESSAGES
INTO itab_bdcmsgcoll.

IF sy-subrc EQ 0.

READ TABLE it_data INTO wa_data INDEX 1.

MESSAGE i009(zmm) WITH wa_data-exnum wa_data-exdat.

ELSE.

MESSAGE i010(zmm) WITH wa_data-exnum wa_data-exdat.

ENDIF.

leave to screen 0.


ENDLOOP
.

0 Kudos

Thanks a lot Aromal. I will try this and let you know.

Thanks,

Priya

0 Kudos

Hi Aromal,

          I have a doubt can BDC applied for my Z program? But in my selection screen I have Po no, doc date, delivery note no,bill of lading, header text, movement reason code, excise inv no and excise inv date. From this data, entered for my Z program I need to create excise details and update the corresponding tables. But in the BDC code you provided are using standard transaction codes and screens right? I am not clear about that part.How will it work. While searching on internet I saw BDC examples where data is uploaded from a file to SAP system and that too for standard transactions.

Thanks & Regards,

Priya

0 Kudos


Hi Aromal,

        I went through BDC tutorials and got some idea about how BDC is working. Now I need some help. In transaction J1IEX_C there are excise base values, bed &aed values populated automatically when we enter the GR no. i.e before creating the excise inv no itself. Please can you tell me from which table I can get these values. I searched a lot and could not find the tables.

Thanks in advance,

Priya

0 Kudos

Hi Priya,

1. use BAPI_GOODS_MOVEMENT_CREATE to create a GR with No excise details. get the GR No and year from this.

2. When you enter the GR No and the year in the transaction J1IEX_C it will ask you enter the excise details. ( use the BDC sample given earlier )

3. You can post the excise details in this transaction.

Regards

Aromal R

0 Kudos

Hi Aromal,

       Thanks for your reply. Yes I had done as you suggested and was able to successfully capture the excise invoice using J1IEX_C tcode but the part1 and part 2 details are not updated. Please can you tell me how we can post using J1IEX_C tcode. I checked the internet and found that we can use J1I5 to update part 1 and J1IEX to post(part2 also updated here). But while creating BDC and executing it the material doc no, posting date and classification is not getting updated on the screen. If I need to run the J1I5 tcode manually. Please can you help me in identifying why the values of material doc no, posting date and classification is not flowing into the screen parameters.

This is my program for   J1I5

   DATA: it_item TYPE TABLE OF ty_part1,
        wa_item TYPE          ty_part1.

  f_option-updmode  = 'L'.
  f_option-defsize  = 'X'.
  f_option-dismode  = 'A'.

  CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
    EXPORTING
      input  = wa_mkpf-budat
    IMPORTING
      output = v_date.

  wa_part1-bukrs = ekko-bukrs.
  wa_part1-werks = ekpo-werks.
  wa_part1-exgrp = wa_final-exgrp.
  wa_part1-mblnr = materialdocument.
  wa_part1-budat = v_date.
  wa_part1-class = 'ROP'.
*  APPEND wa_part1 TO it_part1.
*
*  it_item = it_part1.
*  SORT it_item BY mblnr.
*  DELETE ADJACENT DUPLICATES FROM it_item.
*
*  LOOP AT it_part1 INTO wa_part1.
    PERFORM bdc_dynpro      USING 'J_1IREGSN' '1000'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'C_BTH_MD'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=ONLI'.
    PERFORM bdc_field       USING 'BUKRS'
                                 wa_part1-bukrs. " 'IN10'.
    PERFORM bdc_field       USING 'WERKS'
                                 wa_part1-werks. " 'IN01'.
    PERFORM bdc_field       USING 'EXGRP'
                                 wa_part1-exgrp. "'10'.

*  ENDLOOP.
*
*  LOOP AT it_item INTO wa_item WHERE mblnr = wa_part1-mblnr.

    PERFORM bdc_field       USING 'MBLNR-LOW'
                                 wa_part1-mblnr. " '5000000297'.
    PERFORM bdc_field       USING 'BUDAT-LOW'
                                 wa_part1-budat. " '05.10.2014'.
    PERFORM bdc_field       USING 'P_CLSFCN'
                                  wa_part1-class. "'ROP'.
*    PERFORM bdc_field       USing 'r_doc_dt'
*                              ''.
    PERFORM bdc_field       USING 'R_PST_DT'
                                  'X'.
    PERFORM bdc_field       USING 'R_RG23A'
                                  'X'.
    PERFORM bdc_field       USING 'C_BTH_MD'
                              'X'.

    PERFORM bdc_dynpro      USING 'J_1IREGSN' '1000'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '/EE'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'BUKRS'.
*  PERFORM bdc_transaction USING 'J1I5'.

    CALL TRANSACTION 'J1I5' USING t_bdcdata
    OPTIONS FROM f_option
    MESSAGES INTO itab_bdcmsgcoll.

    IF sy-subrc EQ 0.
      v_subrc = sy-subrc.
    ELSE.

    ENDIF.
*  ENDLOOP.
ENDFORM.                    " UPDATE_PART1

Thanks,

Priya

0 Kudos

Hi Priya,

I have not understood what you are trying to do? Are to trying to post J1I5( Part 1 ) Receipt ( RMA or ROP ) through a BDC program along with MIGO and J1IEX? I think J1I5 is a ALV , have a doubt whehter it can be using the BDC recording.

Even if you are trying to automate J1I5, first fix the Logic how each indicator Receipt or Issue ( RMA,ROP, IDH etc ) are identified from material document. Also you have to restrict the movement type you are using india locatization customization. Also cross check whether the reversal documents are also posting correcting in J1i5.

Regards

Aromal R

0 Kudos

Hi Aromal,

          Yes sorry I did'nt check what type of program is J1I5.....and I corrected it......Now I am doing ROP using J1I5 but I need to check the other logic you had mentioned......But can we post the excise invoice without using J1I5. Were you able to post your excise invoice using only J1IEX_C. Did you use only J1IEX_C and what about part 1 and part2 updation and posting what transaction did you use please?

Thanks & Regards,

Priya

0 Kudos

Dear Priya,

J1IEX_C - Capture Excise Invoice

J1I5        - Part 1 Posting.

J1IEX_P - Post Excise Invoice         - Part 2 Updation

These steps can can be automated, provided you have concerte logic for part1 posting (J1i5). ie J1i5 will list all the material documents (Issue and Receipts ) based on the the localization customization of movement types incuding issues and receipts and  reversals. You need to get more clarity from process perpective to automate J1i5. If you want to put some controls, validations while posting the J1i5 use FM J_1I7_USEREXIT_J1I5_VALIDATE. Also Create a variants for each Classification indicatior, this will allow use to simple click the variant and execute and post.

Hope I answered your question.


Regards

Aromal R

0 Kudos

Hi Aromal,

           Thanks for your reply. Yes I am using these transactions. In  J1I5 I am updating based on the material document and classification as 'ROP'. So will there be any problem? But the problem now I am facing I can update once for a date. Is J1I5 can be executed only once for a date? If I enter the posting date same again it will show that the register is already updated for the period. Please do you know why its showing this error. In that case how will be able to use this transaction. There may be many GR's created on one day and I will be able to update it one for one date. But when we create the excise through MIGO there is no such problem. All the part1 and part2 are updated any no of times.

Thanks & Regards,

Priya


0 Kudos

Hi Aromal,

          I had done BDC recording for all the three transactions:

J1IEX_C

J1I5

J1IEX_P.

The program is working fine when I execute it but the problem appears when the user executes. For him he is getting blocked by an information message' J_1IEXDYNPRO-EXYEAR' does not exist in screen SAPJ1IEX 0001'. I am confused when I execute why I am not getting this error and I am able to post the excise invoice. Because of this error he is not able to post the excise invoice. This error is appearing for him in transaction J1IEX_P.

Please can you help why he is getting this error and I am not??

Thanks & Regards,

Priya

0 Kudos

Hi,

Whether user has any screen variant set for the transaction? First Login and check manully. Also send me the screenshot of the error.

Regards

Aromal R

0 Kudos

Hi Aromal,

        Thanks for your reply. I checked executing the transactions manually there were some configurations missing. I had asked the user to maintain it.

Thanks for your help and support,

Priya

aromalr
Active Participant
0 Kudos

Good to hear that your issues are solved:)