6 Replies Latest reply: Sep 24, 2009 3:11 PM by Micky Oestreich RSS

ABAP Popup menu

Stilianos Spiroglou
Currently Being Moderated

I have added in the user exit save document prepare of sales order the following ABAP code in order to check if the net amount of the sales order is less than 300. If this requirement is met a pop up should begin. The code is the following, theproblem is that it doesn't take into account the amount the way I have written.

 

if vbak-vbtyp     = 'C'       and  " orders only

     ( t180-tcode = 'VA01'    or   " order create or

     t180-tcode = 'VA02' ).        " order change

LOOP AT vbak.

        IF vbak-netwr < '300'.

 

*

*

  • if sy-subrc = 0.

    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

         EXPORTING

              TITEL     = 'Customer Check'(z31)

              TEXTLINE1 = 'Add text here...'(z32)

              TEXTLINE2 = 'and here....'(z33).

  endif.

endloop.

endif.

  • Re: ABAP Popup menu
    Micky Oestreich
    Currently Being Moderated

    Create a variable (or a constant for that matter) with the same type as VBAK-NETWR and assign it the value 300.

     

    I don't see the problem yet. Post the exact code where you do the comparison with vbak-netwr to 300??

    • Re: ABAP Popup menu
      Stilianos Spiroglou
      Currently Being Moderated

      The code is below. Can you help me with the constant or the variable (the abap code)

       

      if vbak-vbtyp     = 'C'       and  " orders only

           ( t180-tcode = 'VA01'    or   " order create or

           t180-tcode = 'VA02' ).        " order change

      LOOP AT vbak.

              IF vbak-netwr < '300'.

       

      *

      *

      • if sy-subrc = 0.

          CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

               EXPORTING

                    TITEL     = 'Customer Check'(z31)

                    TEXTLINE1 = 'Add text here...'(z32)

                    TEXTLINE2 = 'and here....'(z33).

        endif.

      endloop.

      endif.

       

       

       

      ENDFORM.                    "USEREXIT_SAVE_DOCUMENT_PREPARE

      *eject

Actions