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

FQEVENT R402

Former Member
0 Likes
1,415

Hi Experts,

I am using event R402 to create a line in the invocing document.

but I am getting below error.

Please let me know if this is related to functional eror or I am missing any parameter to be passed in R402 event.

Hi Experts,

I am using event R402 to create a line in the invocing document.

but I am getting below error.

Please let me know if this is related to functional eror or I am missing any parameter to be passed in R402 event.

5 REPLIES 5
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,116

This is a functional error as evident from the message you can not post to this account.

Nabheet

Read only

0 Likes
1,116

Hi Nabheet,

Could you help me to find which configuration might be missing.

Thanks,

Akshay

Read only

0 Likes
1,116

Sorry i am a technical guy please get in tocuh with functional and he will change the master data or provide you correct account for the same.

Naheet

Read only

0 Likes
1,116

Sorry i am a technical guy please get in tocuh with functional and he will change the master data or provide you correct account for the same.

Naheet

Read only

0 Likes
1,116

Hi Nabheet,

I am using below piece of code , I hope I am doing right code to add line item while invoicing

I want to make sure that everything is right before I tell it to functional consulatant.

DATA: y_vkk_doc_id_r402 TYPE  isu21_t_vkk_doc_id_r402.
  DATA: l_nettobtr LIKE erdz-nettobtr.
  DATA: lt_op           TYPE fkkop OCCURS 0,                  "CA
        lt_op_one_contr TYPE fkkop OCCURS 0 WITH HEADER LINE, "contract
        l_op       LIKE fkkop,
        l_opupk_ix LIKE sy-tabix.     "index of DPR items of contr.acc.


  DATA: lt_te417 LIKE te417 OCCURS 0 WITH HEADER LINE.
  DATA: l_portion LIKE te422-portion.
  DATA: l_blart LIKE fkkko-blart,
        l_waers LIKE fkkop-waers VALUE 'RON'.


•external represetation of main transaction and sub-transacton of DPR

  DATA: l_hvorg LIKE teivv-hvorg,
        l_tvorg LIKE teivv-tvorg.


  DATA: l_begabrpe LIKE lt_te417-termtdat, "Begin und Ende Abrechnungs
        l_endabrpe LIKE lt_te417-endvoper.


  DATA: l_bill_doc_hochrech      TYPE isu2a_bill_doc.
•       ls_bill_doc_extrapol_ops TYPE /sapce/iu_bbic_billdoc_ops.


•billing documents

  DATA: lt_bill_doc    TYPE isu2a_t_bill_doc,
        l_wa_bill_doc  TYPE isu2a_bill_doc.


  DATA: l_t001 LIKE t001.
  DATA: l_rt_faedn  TYPE fkkr_faedn,   "Range Table fuer FAEDN
        lt_rt_faedn TYPE fkk_rt_faedn.


  DATA: lt_dfkkop LIKE dfkkop OCCURS 0.
  DATA: l_te557 LIKE te557.
  DATA: l_te757 LIKE te757.
  DATA: l_te633 LIKE te633.
  DATA: lt_contrcl LIKE t_contrcl OCCURS 0 WITH HEADER LINE.
  DATA: lt_eitr    LIKE eitr OCCURS 0 WITH HEADER LINE. "Faktur.trigger
  DATA: lt_erch    LIKE erch OCCURS 0 WITH HEADER LINE.
  DATA: lw_erdz    LIKE erdz.
  DATA: lw_fkkopk  LIKE fkkopk.
  DATA: lw_zroisu002 LIKE zroisu002.
  CLEAR: lw_fkkopk.

  SELECT SINGLE * INTO lw_zroisu002

       FROM zroisu002.

  IF sy-subrc <> 0.

    MESSAGE e012(zroisu) RAISING error_message.

    EXIT.

  ENDIF.


◦beispiel lesen aller belege einer id

  PERFORM read_vkk_doc_id_r402 TABLES t_vkk_doc_id

                                      y_vkk_doc_id_r402

                               USING  co_vkkdoc_main.


  LOOP AT  y_vkk_doc_id_r402 INTO  wa_vkk_doc_id_r402.


    PERFORM read_vkk_doc_r402 TABLES t_vkk_doc_id

                              USING  co_vkkdoc_main

                                     wa_vkk_doc_id_r402-tmp_belnr

                                     wa_vkk_doc_r402.

  ENDLOOP.


  LOOP AT x_invoice_unit-print_doc-t_erdz

       INTO lw_erdz

       WHERE belzart = lw_zroisu002-belzart.

    ADD lw_erdz-nettobtr TO l_nettobtr.

  ENDLOOP.

  IF l_nettobtr IS INITIAL.

    EXIT.

  ENDIF.

  l_hvorg = lw_zroisu002-hvorg.

  l_tvorg = lw_zroisu002-tvorg.

  l_blart = lw_zroisu002-blart.


•create local copy of contracts and sort them

  lt_contrcl[] = t_contrcl[].

  READ TABLE lt_contrcl INDEX 1.


■build DPR item (OP)

  CLEAR l_op.

  l_op-bukrs = lt_contrcl-bukrs.

  l_op-gpart = x_bupa-partner.

  l_op-vkont = x_fkkvkp-vkont.

  l_op-spart = lt_contrcl-sparte.


•  convert contract to FI-CA contract reference

  CALL FUNCTION 'ISU_INTERNAL_VERTRAG_TO_VTREF'

    EXPORTING

      i_vertrag = lt_contrcl-vertrag

    IMPORTING

      e_vtref   = l_op-vtref.

  SELECT SINGLE fun01 INTO l_op-hkont

         FROM tfk033d

         WHERE applk = 'R'

         AND   buber = 'R000'

         AND   ktopl = 'GAZ'

         AND   key01 = lt_contrcl-bukrs

         AND   key02 = lt_contrcl-sparte

         AND   key03 = lt_contrcl-kofiz

         AND   key04 = lw_zroisu002-hvorg.

  CHECK sy-subrc = 0.

  l_op-applk = co_applk_isu.

  l_op-hvorg = lw_zroisu002-hvorg.

  l_op-tvorg = lw_zroisu002-tvorg.

  l_op-kofiz = lt_contrcl-kofiz.

  l_op-bldat = x_bldat.

  l_op-budat = x_budat.

  l_op-waers = l_waers.

  l_op-blart = lw_zroisu002-blart.

  l_op-fdgrp = x_fkkvkp-fdgrp.        "CashManagement - planning group

  l_op-opupk = 1.

•l_op-hkont = lw_zroisu002-hkont.

  l_op-betrh = 0 - l_nettobtr.

  l_op-betrw = 0 - l_nettobtr.

•  get LAND1 for further determination of MWSKZ

  SELECT SINGLE * FROM t001 INTO l_t001

                        WHERE bukrs = l_op-bukrs.

  IF sy-subrc NE 0.

    MESSAGE s022(e9) WITH 'T001' l_op-bukrs space space

        RAISING error_message.

  ENDIF.


  APPEND l_op TO lt_op_one_contr.


◦Are there some items for furter processing ?


◦get VAT amount - field SBETW

  PERFORM compute_tax USING lt_op_one_contr.


◦fill deregulation data

  PERFORM fill_deregulation_fields USING lt_op_one_contr.


◦append down-payment request of contract into CA down-paym.collection

  APPEND LINES OF lt_op_one_contr TO lt_op.


  REFRESH lt_op_one_contr.

  SELECT SINGLE fun01 INTO lw_zroisu002-hkont

         FROM tfk033d

         WHERE applk = 'R'

         AND   buber = 'R001'

         AND   ktopl = 'GAZ'

         AND   key01 = lt_contrcl-bukrs

•        AND   key02 = lt_contrcl-sparte

         AND   key03 = lt_contrcl-kofiz

         AND   key04 = lw_zroisu002-hvorg

         AND   key05 = lw_zroisu002-tvorg.

  CHECK sy-subrc = 0.

◦create new FI-CA document if there are some items in LT_OP

  IF NOT lt_op[] IS INITIAL.

•  fill header FKKKO

    y_vkk_doc_new-fkkko-applk = co_applk_isu. "'R'.

    y_vkk_doc_new-fkkko-blart = lw_zroisu002-blart.

    y_vkk_doc_new-fkkko-herkf = 'R4'.      "Herkunft invoicing

    y_vkk_doc_new-fkkko-ernam = sy-uname.

    y_vkk_doc_new-fkkko-cpudt = sy-datum.

    y_vkk_doc_new-fkkko-cputm = sy-uzeit.

    y_vkk_doc_new-fkkko-bldat = x_bldat.

    y_vkk_doc_new-fkkko-budat = x_budat.

    y_vkk_doc_new-fkkko-waers = l_waers.   "Waehrung des letzte Vertrags

    lw_fkkopk-opupk = '1'.

    lw_fkkopk-bukrs = '1930'.

    lw_fkkopk-hkont = lw_zroisu002-hkont.

    lw_fkkopk-betrh = l_nettobtr.

    lw_fkkopk-betrw = l_nettobtr.

    APPEND LINES OF lt_op TO y_vkk_doc_new-n_fkkop.

    APPEND lw_fkkopk      TO y_vkk_doc_new-n_fkkopk.


  ENDIF.


ENDFUNCTION.