cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Trying to assign (SAPLFACI)BKPF to a field-symbol

walkerist79
Participant
0 Kudos
626

Hi, I have a custom program that has 2 IF ELSE conditions.

IF IDOC DOCUMENT IS POSTED.

ASSIGN ('(SAPLFACI)BKPF') TO FIELD-SYMBOL(<FS_BKPF>). <---This is the existing code and it works just fine.

ELSEIF IDOC DOCUMENT IS PARKED.

ASSIGN ('(SAPLFACI)BKPF') TO <FS_BKPF>. <---Tried to add this but it does not work. I'm not sure why. Is it because the IDOC is parked? But they both have accounting documents.

ENDIF.

 

Accepted Solutions (0)

Answers (1)

Answers (1)

MichiFr
Participant
0 Kudos

I've done this several times by just calling one of the function modules of the appropriate function group.

However, this has some possible drawbacks: This procedure requires a function module that can be called without any further impact on the current Idoc, so basically a dummy function module would be fine, e.g. one that gives back a value and does not modify any data.

Maybe the FM FI_ACC_GET would be worth looking at to do a dummy call and the function group is  properly initialized afterwards.

But still the question is, if you assign an external variable, you cannot expect that is has some meaningful value in the field symbol.

Because if you have to apply such tricks as above, the global variables in include SAPLFACI won't have any values either, just initial ones.

walkerist79
Participant
0 Kudos

Okay. I was just trying to get the accounting number related that was generated by my IDOC since I need to use it for mapping values on CFDI. Currently, the data I have is just an IDOC number and I’m not sure where to start