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: 

how to read all operations from memory in IW32

former_member186143
Active Contributor
0 Kudos
2,558

In tcode IW32 I can enter more than 1 operation.

my requirement is that before save a check should be done on all the operations if they are according to requirements. there is no user exit for individual operations that I could find so I try to fix the user exit of the serviceorder for this

EXIT_SAPLCOIH_009 check before save.

but here I need to check also all the new operations entered which should reside somewhere in memory.

only after debugging I can only find the structure AFVGD which contains only the most recent entered operation and not all or at least the newly entered operations.

so when I enter a description at operation 20 and 30 and save. then just before the user exit when I'm still in the main programm SAPLCOIH I don't have any table which contains the information of both operations but only the last one in this case operation 30 ?

anybody got a clue where I can substract all the newly added operations from memory or global variables ??

kind regards

arthur de smidt

1 ACCEPTED SOLUTION

former_member189629
Active Contributor
0 Kudos
1,268

While you debug on SAVE event, I guess CAUFVD should contain all ops data. Find a place to stick an implicit enhancement implementation and you can code your validation.

8 REPLIES 8

former_member189629
Active Contributor
0 Kudos
1,269

While you debug on SAVE event, I guess CAUFVD should contain all ops data. Find a place to stick an implicit enhancement implementation and you can code your validation.

0 Kudos
1,268

caufvd only contains the order information and not of all the individual operations . I'm looking for the table which should contain the operations.

if you look in the screen in the operation tab then with F1 I can see that the AFVGD structure is used for operations. but strange enough it only contains the last operation and not all

kind regards

arthur

0 Kudos
1,268

Hello Arthur,

check function module CO_BT_AFVG_GET. This function module should deliver the required informations.

Best regards

Stephan

0 Kudos
1,268

hmmm I don't see how the function reads the afvgd structure from memory since the information that is changed is not yet saved since I want to check before saving

and somehow I can't get the function to show anything at all when I enter a serviceorder number in testing with SE37 ?

kind regards

arthur de smidt

Edited by: A. de Smidt on Dec 17, 2008 11:00 AM

0 Kudos
1,268

Hello Arthur,

the table AFVG_BT contains the actual operation data (there's no selection from database).

and somehow I can't get the function to show anything at all when I enter a serviceorder number in testing with SE37 ?

-> that's because of the function doesn't select data from the database. Implement the fm in your user-exit, set a break-point, change an operation of an exiting order, add an operation and save. Then you can check the data in table AFVG_BT. You'll find your changes and the additional operation in it.

Best regards

Stephan

Edited by: Stephan Theis on Dec 17, 2008 11:26 AM

0 Kudos
1,268

I try to implement it in

EXIT_SAPLCOIH_009

I have 2 options , the one with 'CO_BT_AFVG_GET'

the exporting parameter only allows a structure and not a table. so not all operations are passed to the user exit




CALL FUNCTION 'CO_BT_AFVG_GET'
  EXPORTING
    aufnr_act           = caufvd_imp-aufnr
*   AUFPL_ACT           = 0000000000
*   FLG_WORK            = 'X'
*   FLG_DELETED         = ' '
  IMPORTING
   AFVGD_EXP           = lt_AFVGD

*   AFVG_BT_INDEX       =
*   RCR01_EXP           =
*   VBKZ_EXP            =
* EXCEPTIONS
*   EOF                 = 1
*   OTHERS              = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

I can see that the function above contains all the operations. only it doesn't return them

the other option is to read it from memory but that returs nothing


    CLEAR global_field_name.
    MOVE '(SAPLCOBT)AFVG_BT[]'  TO global_field_name.
    ASSIGN (global_field_name) TO <fs_afvg_bt>.

I also found a user exit in function CO_BT_ORDER_POST which contains the info of all the posted and unposted operations in table afvg_bt

but the problem here is that I can't raise error messages if some fields in the operation are not filled

kind regards

arthur

Edited by: A. de Smidt on Dec 17, 2008 3:04 PM

1,268

ok I got the solution through the function 'CO_BT_AFVG_GET'.

I used that program now in my dynamic reading and that contains all the information I need

so I use SAPLCOBO instead of SAPLCOBT now


    CLEAR global_field_name.
    MOVE '(SAPLCOBO)AFVG_BT[]'  TO global_field_name.
    ASSIGN (global_field_name) TO <fs_afvg_bt>.

thanks

arthur

2SAP
Discoverer
0 Kudos
1,237

I use function CO_BT_AFVG_GET_ALL