cancel
Showing results for 
Search instead for 
Did you mean: 

How to update other infotype from source infotype via function module?

okh
Explorer
0 Kudos

Want in source infotype to call a func.module, which shall update other infotype(s) in background.

Have tried out with HR_INFOTYPE_OPERATION, but without success - gives mitchmatch of source it and target it in the internal it buffer tables.

How to do?

Requirements also are to secure rollback, if update of the last of ex. 3 target its fails.

Anyone has experience on this issue?

Regards Søren

Accepted Solutions (0)

Answers (1)

Answers (1)

nablan_umar
Active Contributor
0 Kudos

Hi Soren,

Each infotype has a different table structure. From what I understand your problem, you get an error of mismatch source and target. When you want to create another infotype, make sure the target infotype structure is fully populated.

If this is not the problem you are having, please provide us the code.

okh
Explorer
0 Kudos

Ex. From own it9300 a field is changed. When this field is changed, a CI-field in it0003 shall be changed. In PAI of it9300 an own func.module is called (this to avoid redundant coding, because it's used from other places).

In this own fm it0003 is maintained ok by means of fm HR_INFOTYPE_OPERATION, however - when coming back to PAI of it9300 and the change of the it9300 record is to be updated on the data base, en error message occurs that the it9300 rec does not exist! By debugging we see that the message occurs, because the it9300 has now disappeared from the int. buffer table PS.

Regards Søren

nablan_umar
Active Contributor
0 Kudos

Hi Soren,

You might want to try using Dynamic Measure in table T588Z (maintainable using SM30). Enter the field name of IT9300 that you change in column Field Name. Then use function character 06 for change or insert. Enter step I and W. Roughly, set it like this

Ity Sty Field N FC No S Variable function part

9300 fieldname 06 01 I MOD,0003,,,(P9300-BEGDA),(P9300-ENDDA)

9300 fieldname 06 02 W p0003-ci_field = 'x'

okh
Explorer
0 Kudos

Know this functionality - also by means of own coding in the PAI by filling the int. tables dynmeas + initial_values. However the issue remains, i.e. the update has to be done by a function module called from PAI of own infotype, and from a function module you can't trigger the T588Z-functionality.

The update of it0003 from own it9300 is only an example, have general requirements that:

- from own infotype PAI a function module shall be called

- from the function module update of other infotypes

shall take place (modify as well as insert and delete)

- if more infotypes shall be updated from source infotype,

rollback shall take place if ex. update of last target

infotype fails (all to be updated or none!).

Regards Søren

nablan_umar
Active Contributor
0 Kudos

When you are you updating IT9300 or your own infotype, are you using SAP transaction PA30?

okh
Explorer
0 Kudos

Yes, we use PA30 / Søren

nablan_umar
Active Contributor
0 Kudos

If it is, I don't understand why dynamic measure would not work. Based on your requirements, you want to update IT 0003 when you made changes to your custom infotype. PA30 will call dynamic measure. It will be called within PAI of PA30 while you are maintaining your custom Infotype.

ssimsekler
Active Contributor
0 Kudos

Hi Søren

I am not sure whether this will work. Try using the FM

'HR_PSBUFFER_INITIALIZE'

or

'HR_BUFFER_INITIALIZE'

after you do update with

'HR_INFOTYPE_OPERATION'

.

Hope this helps...

*--Serdar

okh
Explorer
0 Kudos

Have tried the 2 FuBa's 'HR_PSBUFFER_INITIALIZE' and 'HR_BUFFER_INITIALIZE', however they refresh the PS.

What I'm missing is the re-entry of it9300 into PS.

(PS contains it9300 before the update with 'HR_INFOTYPE_OPERATION').

sergey_korolev
Active Contributor
0 Kudos

Hi Søren,

I've just browsed through the source code, and found that they use PERFORM to add/modify another infotype simultaneously:

PERFORM insert_infotyp(sapfp50p) USING itNNNN ...
PERFORM modify_infotyp(sapfp50p) USING itNNNN ...

Sorry, it's just an idea, I did not try it myself.