Application Development and Automation 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: 
Read only

Infotype screen extension

Former Member
0 Likes
860

Hi everyone,

I extended an infotype. I modified the Structure, and the screen, and everything works perfectly, but there is a problem:

In the standard screen there is a FIeld P0004-SBGRU

I would like to implement a check in the PAI, where I check if the P004-SBGRU = 'H2' then P0004-SBPRO OR P0004-ZZ_SBPRO must be filled.

pseudo code:


IF P0004-SBGRU EQ 'H2'.
  IF P0004-SBPRO IS INITIAL  AND P0004-ZZ_SBPRO IS INITIAL
     MESSAGE e055(00). "one of the field is obligatory
  ENDIF.
ENDIF.

The problemis that in my customer subscreen, I can only acces the Z fields:


CHAIN.
    FIELD P0004-ZZ_SBPRO.
    MODULE INPUT_STATUS_SUBSCREEN ON CHAIN-REQUEST.
    MODULE CHECK_CATEGORY ON CHAIN-REQUEST.
 ENDCHAIN.

My question is:

:Is it possible to check the main screen's field in the subscreen? (without modifying SAP standard screen)

Thanks

N.G.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
769

Hello

Yes you can access your screen values from the main program by reading the call stack.

You can use the below code,


field-symbols : <fs1> type any.
field-symbols : <fs2> type any.
constants : lv_char1 type string value '(MP000400)P0004-SBPRO'.
constants : lv_char2 type string value '(MP000400)P0004-SBGRU'.

assign (lv_char1) to <fs1>.
assign (lv_char2) to <fs2>.

if <fs2> = 'H2'.
  IF <fs1> IS INITIAL  AND P0004-ZZ_SBPRO IS INITIAL
     MESSAGE e055(00). "one of the field is obligatory
  ENDIF.
endif.

Regards

Ranganath

Hi everyone,

I extended an infotype. I modified the Structure, and the screen, and everything works perfectly, but there is a problem:

In the standard screen there is a FIeld P0004-SBGRU

I would like to implement a check in the PAI, where I check if the P004-SBGRU = 'H2' then P0004-SBPRO OR P0004-ZZ_SBPRO must be filled.

pseudo code:


IF P0004-SBGRU EQ 'H2'.
  IF P0004-SBPRO IS INITIAL  AND P0004-ZZ_SBPRO IS INITIAL
     MESSAGE e055(00). "one of the field is obligatory
  ENDIF.
ENDIF.

The problemis that in my customer subscreen, I can only acces the Z fields:


CHAIN.
    FIELD P0004-ZZ_SBPRO.
    MODULE INPUT_STATUS_SUBSCREEN ON CHAIN-REQUEST.
    MODULE CHECK_CATEGORY ON CHAIN-REQUEST.
 ENDCHAIN.

My question is:

:Is it possible to check the main screen's field in the subscreen? (without modifying SAP standard screen)

Thanks

N.G.

4 REPLIES 4
Read only

Former Member
0 Likes
770

Hello

Yes you can access your screen values from the main program by reading the call stack.

You can use the below code,


field-symbols : <fs1> type any.
field-symbols : <fs2> type any.
constants : lv_char1 type string value '(MP000400)P0004-SBPRO'.
constants : lv_char2 type string value '(MP000400)P0004-SBGRU'.

assign (lv_char1) to <fs1>.
assign (lv_char2) to <fs2>.

if <fs2> = 'H2'.
  IF <fs1> IS INITIAL  AND P0004-ZZ_SBPRO IS INITIAL
     MESSAGE e055(00). "one of the field is obligatory
  ENDIF.
endif.

Regards

Ranganath

Read only

0 Likes
769

Hi Ranganath,

Thank you for your answer, but this is not a solution for my problem. You don't need to use the stack in the infotype subscreen, because the whole pnnnn structure is available, so you can use the P0004-SBPRO directly.

My problem is int he module. the CHAIN-ENDCHAIN section. As you know, you should specify the every field which is relevant for the check here. In this case two field is relevant:

- P0004-SBPRO (standard field on the standard screen)

- P0004-ZZ_SBPRO (customer field on the customer screen)

The problem is that in the customer module (ZP000400) I can only add the P0004-ZZ_SBPRO between the CAHIN-ENDCHAIN segment, because the P0004-SBPRO is definied in the infotype main module (MP000400) But I need this field in the check , because I have to check both of them in the same CHAIN.

As I see there is no other option, I have to add it to the customer inculde of the main module MP000400

Bye

N.

Read only

0 Likes
769

Got the requirement wrong ...

But just to have the fields open for input when you raise a error message you need the fields to be added between CHAIN ... ENDCHAIN. I agree with your current design only the Z field will be open for input when you raise error message.

But the infotype framwork is designed such that. Ideally uou should not be adding the Z field to the standard module pool of the infotype, as doing it may allow the std. infotype to work in right way. Check in SAP help for exact places you need to make changes if you are modifying the std. screen. There is a detailed topic regarding that, which details which modules in PBO and PAI you can modify, and also if you are adding custom modules where exactly you need to add them.

Regards

Ranganath

Read only

0 Likes
769

Hi Ranganath,

I don't want to change the SAP standrd screen. So I impemented the check is the Standard customer function of the infotype screen checks. This is is not the best solution because if there is an error, then not just the two questionable field is highlighted, all of the fields are editable.

Anyway, thanks for the help, now I 100% sure, that this is the only acceptable solution.

Bye

N.