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

Surpress GET PERNR?

Former Member
0 Likes
1,159

How do I suppress the GET PERNR event? I have a report where I do a table dump of T710 or output PA0008 based upon TAB selection. However, I want to prevent performance problem when I just want to dump T710 table. The GET PERNR event seems to output regardless of what TAB is selected. Here is a sample code:


START-OF-SELECTION.

  CASE P_TABSEL.
    WHEN 'T510'.
      P_IT08CHECK = ''.
      PERFORM 100.
    WHEN 'T710'.
      P_IT08CHECK = ''.
      PERFORM 110.
    WHEN 'IT08'.
      P_IT08CHECK = 'X'.
        GET PERNR.
    WHEN 'T510U'.
      P_IT08CHECK = ''.
      PERFORM 130.
  ENDCASE.

This doesn't work because I can't encapsulate the "GET PERNR" in an IF statement of in the FORM statement. Any idea how to ONLY activate the GET PERNR event when I have a particular tab selected?

How do I suppress the GET PERNR event? I have a report where I do a table dump of T710 or output PA0008 based upon TAB selection. However, I want to prevent performance problem when I just want to dump T710 table. The GET PERNR event seems to output regardless of what TAB is selected. Here is a sample code:


START-OF-SELECTION.

  CASE P_TABSEL.
    WHEN 'T510'.
      P_IT08CHECK = ''.
      PERFORM 100.
    WHEN 'T710'.
      P_IT08CHECK = ''.
      PERFORM 110.
    WHEN 'IT08'.
      P_IT08CHECK = 'X'.
        GET PERNR.
    WHEN 'T510U'.
      P_IT08CHECK = ''.
      PERFORM 130.
  ENDCASE.

This doesn't work because I can't encapsulate the "GET PERNR" in an IF statement of in the FORM statement. Any idea how to ONLY activate the GET PERNR event when I have a particular tab selected?

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,050

Could you possibily use the REJECT keyword. I don't know, I've never worked with logical databases. Do F1 help on the keyword REJECT.

Regards,

Rich Heilman

Read only

0 Likes
1,050

The REJECT keyword says 'I do not want to continue processing with the data row you have returned to me'. By that time, the database has already been read and a row returned to your program. If there were more tables hierarchically hanging off the REJECTed row, they would not be processed further and therefore the read of those tables would be avoided.

Read only

Former Member
0 Likes
1,050

Check the selection screen of the LDB. If it is blank then GET PERNR should not get activated but if you/system selects somebody then it will be called. So it means you cannot use PNP LDB variables to process in your T710 processor.

One option would be to CLEAR out all your PNP variables in your START-OF-SELECTION part.

HTH

Swapan

Read only

Former Member
0 Likes
1,050

I just stort of tweak it and did this. Seems to work so far

CASE P_TABSEL.
    WHEN 'T510'.
      P_IT08CHECK = ''.
      PERFORM 100.
      STOP.
    WHEN 'T710'.
      P_IT08CHECK = ''.
      PERFORM 110.
      STOP.
    WHEN 'IT08'.
      P_IT08CHECK = 'X'.
    WHEN 'T510U'.
      P_IT08CHECK = ''.
      PERFORM 130.
      STOP.
  ENDCASE.

GET PERNR. 

Read only

ssimsekler
Product and Topic Expert
Product and Topic Expert
0 Likes
1,050

Hi Kevin

It is OK to use STOP statement.

*--Serdar

[email protected]

Read only

Former Member
1,050

Some clarification on the meaning of GET might help you out in the future. It is a commonly misunderstood ABAP statement. GET looks like a verb, sort of like MOVE, but it is really the name of an SAP event, just like other events like AT SELECTION-SCREEN and START-OF-SELECTION.

Whenever I teach new ABAPers about GET, I tell them to think of this as a noun rather than a verb. So instead of thinking GET, think of WHEN.

So GET PERNR is really an event called WHEN PERNR and means that when the LDB has a PERNR row available, invoke the code you have attached to event GET PERNR. Trying to bury the statement GET PERNR inside other executable ABAP statements like IF and FORM is not supported because your code does not decide when to do this, it is decided by the LDB. In fact if you code the following:

IF condition.
  GET PERNR.
ENDIF.

What the compiler sees is an event called GET PERNR. The start of an event, ends the previous event. If you never specified an event then the default event is START-OF-SELECTION.

So the previous event is ended, but we have an IF without an ENDIF. If the compiler could get past that error, the next error would be an ENDIF without an IF.

As an aside, if you have ever wondered where the ABAP events START-OF-SELECTION and END-OF-SELECTION got their names, START-OF-SELECTION represents the start of selection by the LDB before any data is returned to your program. Likewise, END-OF-SELECTION represents the fact that the LDB has finished returning data to your program.