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

Error - Pricing error Mandatory condition MWST is missing.

former_member509264
Discoverer
0 Likes
573

Hi expertsu2026

I have a BCD to cancel billing plans, but an error occurred when I run mi program in u2018Eu2019 mode, the error is V1801. Only when I have a material with item category type text (No pricing, No Taxes). In the normal process the error is common, and the user press enter and continues with the process in the Tx VA02.

What can I do?..

This is my codeu2026

Best regardsu2026

LOOP AT it_vbak INTO wa_vbak.

    LOOP AT it_tab INTO wa_tab
            WHERE text = wa_vbak-bstnk.
      v_fecha = wa_tab-date.


      tran_opts-dismode = 'A'.
      tran_opts-updmode = 'A'.

      CLEAR bdcdata.
      REFRESH bdcdata.

      PERFORM bdc_dynpro USING 'SAPMV45A' '0102'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'VBAK-VBELN'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
      PERFORM bdc_field  USING 'VBAK-VBELN' wa_vbak-vbeln.

      LOOP AT it_vbap INTO wa_vbap
        WHERE vbeln = wa_vbak-vbeln
        AND pstyv = 'Z006'
         OR pstyv = 'Z010'
         OR pstyv = 'Z012'
         OR pstyv = 'Z024'
         OR pstyv = 'Z036'
         OR pstyv = 'Z048'
         OR pstyv = 'Z060'

         OR pstyv = 'ZT06'
         OR pstyv = 'ZT10'
         OR pstyv = 'ZT12'
         OR pstyv = 'ZT24'
         OR pstyv = 'ZT36'
         OR pstyv = 'ZT48'
         OR pstyv = 'ZT60'.

* Z006, Z010, Z012, Z024, Z036, Z048, Z060, ZPF.
* ZT06, ZT10, ZT12, ZT24, ZT36, ZT48, ZT60

        PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=POPO'.
        PERFORM bdc_dynpro USING 'SAPMV45A' '0251'.
        PERFORM bdc_field  USING 'BDC_CURSOR' 'RV45A-POSNR'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=POSI'.
        PERFORM bdc_field  USING 'RV45A-POSNR' wa_vbap-posnr.
        PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=ITEM'.
        PERFORM bdc_field  USING 'BDC_CURSOR' 'VBAP-POSNR(01)'.
        PERFORM bdc_dynpro USING 'SAPMV45A' '4003'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=T\05'.

        PERFORM bdc_dynpro      USING 'SAPLV60F' '4001'.
        PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR' 'FPLA-ENDAT'.
        PERFORM bdc_dynpro      USING 'SAPLV60F' '4001'.
        PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_field       USING 'FPLA-ENDAT' v_fecha.

        PERFORM bdc_dynpro USING 'SAPLV60F' '4001'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=S\BACK'.

      ENDLOOP.

      PERFORM bdc_dynpro      USING 'SAPMV45A' '4001'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=SICH'.

    ENDLOOP.

    CALL TRANSACTION 'VA02'
    USING bdcdata
    OPTIONS FROM  tran_opts
    MESSAGES INTO ierror.
    COMMIT WORK.

  ENDLOOP.

Hi expertsu2026

I have a BCD to cancel billing plans, but an error occurred when I run mi program in u2018Eu2019 mode, the error is V1801. Only when I have a material with item category type text (No pricing, No Taxes). In the normal process the error is common, and the user press enter and continues with the process in the Tx VA02.

What can I do?..

This is my codeu2026

Best regardsu2026

LOOP AT it_vbak INTO wa_vbak.

    LOOP AT it_tab INTO wa_tab
            WHERE text = wa_vbak-bstnk.
      v_fecha = wa_tab-date.


      tran_opts-dismode = 'A'.
      tran_opts-updmode = 'A'.

      CLEAR bdcdata.
      REFRESH bdcdata.

      PERFORM bdc_dynpro USING 'SAPMV45A' '0102'.
      PERFORM bdc_field  USING 'BDC_CURSOR' 'VBAK-VBELN'.
      PERFORM bdc_field  USING 'BDC_OKCODE' '/00'.
      PERFORM bdc_field  USING 'VBAK-VBELN' wa_vbak-vbeln.

      LOOP AT it_vbap INTO wa_vbap
        WHERE vbeln = wa_vbak-vbeln
        AND pstyv = 'Z006'
         OR pstyv = 'Z010'
         OR pstyv = 'Z012'
         OR pstyv = 'Z024'
         OR pstyv = 'Z036'
         OR pstyv = 'Z048'
         OR pstyv = 'Z060'

         OR pstyv = 'ZT06'
         OR pstyv = 'ZT10'
         OR pstyv = 'ZT12'
         OR pstyv = 'ZT24'
         OR pstyv = 'ZT36'
         OR pstyv = 'ZT48'
         OR pstyv = 'ZT60'.

* Z006, Z010, Z012, Z024, Z036, Z048, Z060, ZPF.
* ZT06, ZT10, ZT12, ZT24, ZT36, ZT48, ZT60

        PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=POPO'.
        PERFORM bdc_dynpro USING 'SAPMV45A' '0251'.
        PERFORM bdc_field  USING 'BDC_CURSOR' 'RV45A-POSNR'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=POSI'.
        PERFORM bdc_field  USING 'RV45A-POSNR' wa_vbap-posnr.
        PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=ITEM'.
        PERFORM bdc_field  USING 'BDC_CURSOR' 'VBAP-POSNR(01)'.
        PERFORM bdc_dynpro USING 'SAPMV45A' '4003'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=T\05'.

        PERFORM bdc_dynpro      USING 'SAPLV60F' '4001'.
        PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_field       USING 'BDC_CURSOR' 'FPLA-ENDAT'.
        PERFORM bdc_dynpro      USING 'SAPLV60F' '4001'.
        PERFORM bdc_field       USING 'BDC_OKCODE' '/00'.
        PERFORM bdc_field       USING 'FPLA-ENDAT' v_fecha.

        PERFORM bdc_dynpro USING 'SAPLV60F' '4001'.
        PERFORM bdc_field  USING 'BDC_OKCODE' '=S\BACK'.

      ENDLOOP.

      PERFORM bdc_dynpro      USING 'SAPMV45A' '4001'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=SICH'.

    ENDLOOP.

    CALL TRANSACTION 'VA02'
    USING bdcdata
    OPTIONS FROM  tran_opts
    MESSAGES INTO ierror.
    COMMIT WORK.

  ENDLOOP.

1 REPLY 1
Read only

Former Member
0 Likes
410

Just add ENTER command whereever you get the error. If its after executing the save command, you code should be

PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.

PERFORM bdc_field USING 'BDC_OKCODE' '=SICH'.

IF WA_VBAP-PSTYV = <Text item category>.

PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.

PERFORM bdc_field USING 'BDC_OKCODE' '/ENT'.

ENDIF.

If its before then move the above IF statement before SAVE Command (or whereever appropriate).

Raj

PS: Please remember to award points if my answer was helpful.