Skip to Content
-1

I get problem in USEREXIT_FIELD_MODIFICATION

I wnt to make disbale screen input with some condition, one of codition is USER STATUS. i use FM status_text_edit to get value of user status. like my code below.

But there is problem, when user change user status, it's error.

FORM USEREXIT_FIELD_MODIFICATION.

DATA : it_status TYPE STANDARD TABLE OF jstat,
       wa_status LIKE LINE OF it_status,
       lv_objnr TYPE vbak-objnr,
       lv_line TYPE BSVX-STTXT,
       lv_status TYPE BSVX-STTXT.
CLEAR : lv_objnr.
REFRESH it_status.
SELECT SINGLE objnr FROM vbak INTO lv_objnr WHERE vbeln = vbak-vbeln.


CALL FUNCTION 'STATUS_TEXT_EDIT'
  EXPORTING
   CLIENT                  = SY-MANDT
   FLG_USER_STAT           = 'X'
    objnr                   = lv_objnr
    ONLY_ACTIVE             = 'X'
    spras                   = sy-langu
*   BYPASS_BUFFER           = ' '
 IMPORTING
*   ANW_STAT_EXISTING       =
*   E_STSMA                 =
   LINE                    = lv_line
   USER_LINE                = lv_status
*   STONR                   =
 EXCEPTIONS
   OBJECT_NOT_FOUND        = 1
   OTHERS                  = 2
          .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

 IF sy-tcode EQ 'VA02'.
   IF sy-uname NE 'STC25' AND sy-uname NE 'STC26'.
     IF  lv_status  EQ 'AP' or   lv_status EQ 'CBDA'.  "AP AND CBDA"
        CASE SCREEN-NAME.
          WHEN 'RV45A-KWMENG'.
                IF VBAP-PSTYV EQ 'ZPPR'.
          SCREEN-input = 0.
                 MODIFY SCREEN.
                ENDIF.
          WHEN 'VBAP-VRKME'.
            IF VBAP-PSTYV EQ 'ZPPR'.
                 SCREEN-input = 0.
                 MODIFY SCREEN.
            ENDIF.
          WHEN 'VBEP-WMENG'.
            IF VBAP-PSTYV EQ 'ZPPR'.
                 SCREEN-input = 0.
                 MODIFY SCREEN.
            ENDIF.
       ENDCASE.
      ENDIF.
   ENDIF.
 ENDIF.


ENDFORM.
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Mar 26 at 07:48 AM

    LOOP AT SCREEN

    ENDLOOP

    Is missing

    Please see the code below

      IF sy-tcode EQ 'VA02'.
        IF sy-uname NE 'STC25' AND sy-uname NE 'STC26'.
          IF  lv_status  EQ 'AP' OR   lv_status EQ 'CBDA'.  "AP AND CBDA"
            LOOP AT SCREEN.
              CASE screen-name.
                WHEN 'RV45A-KWMENG'.
                  IF vbap-pstyv EQ 'ZPPR'.
                    screen-input = 0.
                    MODIFY SCREEN.
                  ENDIF.
                WHEN 'VBAP-VRKME'.
                  IF vbap-pstyv EQ 'ZPPR'.
                    screen-input = 0.
                    MODIFY SCREEN.
                  ENDIF.
                WHEN 'VBEP-WMENG'.
                  IF vbap-pstyv EQ 'ZPPR'.
                    screen-input = 0.
                    MODIFY SCREEN.
                  ENDIF.
              ENDCASE.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.