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: 

ABAVN-> Multiply assets doesn't update ANLN2 | FM 'AMDP_TABLE_CONTROL_FOR_POSTING'

shiz0frenik
Participant
0 Kudos

Hi,experts how to fill ANLN2 field at ABAVN t-code.

I found an FM ' AMDP_TABLE_CONTROL_FOR_POSTING'. 
Here  LT_FIAA_BUS1022_WF - is a displayed table and i need to change ANLN2 field to '0000' if it's initial.
In code i found this condition, but this field  not mentioned at MODIFY statement lately.
How to add it. Or mb it's possible to change it at another block.

 USER_COMMAND_0110 .

 

 

 IF U_FCODE = GC_FCSAVE OR
      U_FCODE = GC_FCSHWI OR
      U_FCODE = GC_FCSHWD OR
      U_FCODE = GC_FCRTRN OR
      U_FCODE = SPACE.

      CALL FUNCTION 'STC1_GET_DATA'
           EXPORTING TAB_HANDLE = GD_HANDL_TC1
           TABLES    TABLE      = LT_FIAA_BUS1022_WF.
   ENDIF.

*  Bezeichnungen der Anlagen besorgen
   IF U_FCODE = SPACE.
      CALL FUNCTION 'AMSP_ASSET_READ_FROM_BUFFER'
           TABLES     T_ANTS = LT_ANTS.

      LOOP AT  LT_FIAA_BUS1022_WF.
*        IF LT_FIAA_BUS1022_WF-TXT50 IS INITIAL.              < 1241474
         IF LT_FIAA_BUS1022_WF-BUKRS IS INITIAL.
            LT_FIAA_BUS1022_WF-BUKRS = RAIFP2-BUKRS.
         ENDIF.
         IF LT_FIAA_BUS1022_WF-ANLN2 IS INITIAL.
            LT_FIAA_BUS1022_WF-ANLN2 = '0000'.
         ENDIF.
         READ TABLE LT_ANTS
              WITH KEY BUKRS = LT_FIAA_BUS1022_WF-BUKRS
                       ANLN1 = LT_FIAA_BUS1022_WF-ANLN1
                       ANLN2 = LT_FIAA_BUS1022_WF-ANLN2.
         IF SY-SUBRC = 0.
            LT_FIAA_BUS1022_WF-TXT50 = LT_ANTS-TXT50.
         ENDIF.
*        ENDIF.                                               < 1241474

         IF LT_FIAA_BUS1022_WF-PANL1 <> SPACE AND
            LT_FIAA_BUS1022_WF-PATXT IS INITIAL.
            LT_FIAA_BUS1022_WF-PBUKR = RAIFP3-BUKRS.
            IF LT_FIAA_BUS1022_WF-PANL2 IS INITIAL.
               LT_FIAA_BUS1022_WF-PANL2 = '0000'.
            ENDIF.
            READ TABLE LT_ANTS
                 WITH KEY BUKRS = LT_FIAA_BUS1022_WF-PBUKR
                          ANLN1 = LT_FIAA_BUS1022_WF-PANL1
                          ANLN2 = LT_FIAA_BUS1022_WF-PANL2.
            IF SY-SUBRC = 0.
               LT_FIAA_BUS1022_WF-PATXT = LT_ANTS-TXT50.
            ENDIF.
         ENDIF.
         MODIFY LT_FIAA_BUS1022_WF TRANSPORTING TXT50 PATXT.
      ENDLOOP.

      CALL FUNCTION 'STC1_PUT_DATA'
           EXPORTING HANDLE = GD_HANDL_TC1
           TABLES    TABLE  = LT_FIAA_BUS1022_WF.
   ENDIF.

 

 

 

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

For your information, you may call any possible portion of ABAP code in the system (like AMDP_TABLE_CONTROL_FOR_POSTING), but the challenge is to find one which is permitted by SAP e.g. released BAPI, batch input, user exit, SAP-documented programs, etc.

0 Kudos

I can't find any user-exit or badi inside program.
How i can call it inside SAP code?

Sandra_Rossi
Active Contributor
0 Kudos

Do you mean filling this field right after starting ABAVN ? Or at what other moment?

Sandra_Rossi_0-1716290993314.png

 

shiz0frenik_0-1716291880240.png

I want to assign '0' to them if it's initial.
After entrying an asset number.