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

Passing TABLE into SUBRUTINE in standard code for ATP check.

ansenko
Participant
0 Kudos
750

Hello.

I'm working under custom FM that calls BAPI_MATERIAL_AVAILABILITY and pretend to be validated with CO09.

Case A.

1. FM BAPI_MATERIAL_AVAILABILITY populate with 1 record l_atpcs successfully and pass it to FM AVAILABILITY_CHECK_CONTROLLER  as p_atpcsx.

2. AVAILABILITY_CHECK_CONTROLLER pass it to FM AVAILABILITY_CHECK with the same name.

3. AVAILABILITY_CHECK pass it to subroutine AVAILABILITY_CHECK_APO. But after jumping to subroutine debugger shows that number of records in p_atpcsx become zero.

ATP Case A.png

Case B.

1. After ruining CO09 it finally calls AVAILABILITY_CHECK and p_atpcsx has 1 record.

2. AVAILABILITY_CHECK pass it to subroutine AVAILABILITY_CHECK_APO. But now p_atpcsx keeping 1 record.

ATP Case B.png

Taking into account the fact that it is one material from the same plant, can someone explain why in one case the values are passed and in the other case they are not?

Accepted Solutions (1)

Accepted Solutions (1)

RaymondGiuseppi
Active Contributor

Did you debug form SPLIT_OF_NOT_CHECKED of function group ATPC.

(remove not related records from p_atpcsx, save them in temporary l_atpcsx_nocheck, and append those back at end of process)

ansenko
Participant
0 Kudos

Thanks Raymond. SPLIT_OF_NOT_CHECKED returns filled records in both cases.

There are 3 differences:

1. CHMOD: ZFM="", CO09 = "EXP"

2. BDMNG:ZFM="here I pass requested quantity", CO09="0.00"

3. TRTYP: ZFM="V", CO09="A".

In both cases I have 1 record in p_atpcsx before I jump to AVAILABILITY_CHECK_APO.

RaymondGiuseppi
Active Contributor
Table parameter p_atpcsx is second parameter of form availability_check_apo, so in AVAILABILITY_CHECK call of the form it's refer to l_atpapo-atpcsx, not to p_atpcsx. Once again, go to SPLIT_TABLES form.

Answers (1)

Answers (1)

ansenko
Participant
0 Kudos

Hi @Ryan-Crosby 

I got your point. But let me clarify the situation from my observation point.

I'm on the line with PERFORM AVAILABILITY_CHECK_APO.... debugger cursor. p_atpcsx has 1 record.

I press F5 and jump to the first executable statement in subroutine. Just common declaration statement between FORM AVAILABILITY_CHECK_APO and debugger cursor?  And I have 1 record in one case and 0 in other.

This is standard code you can check FM AVAILABILITY_CHECK if you have ECC6 and I believe that S/4HANA keep this FM as well.

I appreciate for your attempt, but I would like to avoid reading obvious advice. Could you please correct this by being more specific?

 

Sandra_Rossi
Active Contributor
0 Kudos
Please don't post an answer, which is reserved to propose a solution. Instead click on "Show replies" and then "Comment".