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

SUBMIT for a program using LDP PNPCE Not Working Properly

Former Member
0 Likes
2,221

I am calling a program that uses the Logical Data Base PNPCE via the SUBMIT Statment and isn't using my parameters. I am passing it the PERNRS that I want to use and when I check PNPPERNR in the called program I see the list of PERNRS that I submitted, however when the GET PERAS command is issued, the structure PERNR contains the number of the first PERNR in the system, not one of mine. I know that behind the scenes there is another program executing to fill the LDB, but I thought it would use the PERNRS I submitted.

SUBMIT ZPAPAI0026_CREAT_MERT_INCR_ONG

WITH PNPPERNR IN RA_PERNR

WITH P_TEST EQ P_TEST

WITH PNPTIMED EQ 'D'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,674

Still no luck. I am not using the LDP in the triggering program if that makes any difference.

Here is most of the program:

RANGES:

RA_GSBER FOR ZHCM_MERIT_ELIG-GSBER,

RA_WERKS FOR ZHCM_MERIT_ELIG-WERKS.

DATA: RA_PERNR TYPE RANGE OF PERNR WITH HEADER LINE.

**********

*INITIALIZATON

**********

INITIALIZATION.

gc_page_title = Text-001.

SET CURSOR FIELD 'P_RDATE'.

****************************************************************************************

    • S T A R T O F S E L E C T I O N

****************************************************************************************

start-of-selection.

SELECT SINGLE * FROM T549Q

WHERE BEGDA <= P_RDATE

AND ENDDA >= P_RDATE

AND PERMO = '04'.

IF SY-SUBRC = 0.

ZBEGDA = T549Q-BEGDA - 28.

ENDIF.

CLEAR: WA_RPT_REC.

ZSKIP = 'N'.

SELECT * FROM ZHCM_MERIT_ELIG

WHERE PERNR IN S_PERNR

AND GSBER IN S_GSBER

AND WERKS IN S_WERKS

AND ( ELIGIBLE = 'X' OR NOT_ELIGIBLE = 'X' )

AND BEGDA >= ZBEGDA

AND BEGDA <= P_RDATE.

ZRECS_READ = ZRECS_READ + 1.

PERFORM INSERT_RPT_REC.

IF ZRECS_READ = P_BCNT.

PERFORM SUBMIT_ZPAPAI0026.

CLEAR: RA_PERNR,

RA_GSBER,

RA_WERKS.

REFRESH:RA_PERNR,

RA_GSBER,

RA_WERKS.

ZFIRST = 'Y'.

ZRECS_READ = 0.

ENDIF.

ZRECS_READ = ZRECS_READ + 1.

PERFORM BUILD_SELECTION_FIELDS.

ENDSELECT.

IF ZRECS_READ > 0.

PERFORM SUBMIT_ZPAPAI0026.

ENDIF.

****************************************************************************************

    • E N D O F S E L E C T I O N

****************************************************************************************

END-OF-SELECTION.

DESCRIBE TABLE T_RPT_REC LINES ZLINES.

IF ZLINES = 0.

MESSAGE I099 WITH 'NO MERIT INCREASE RECORDS CREATED'.

ELSE.

PERFORM DISPLAY_EMPLOYEE USING T_RPT_REC

ZBEGDA

P_RDATE

'MERIT INCREASE SPILTTER REPORT'.

ENDIF.

***********************************************************************

  • BUILD_SELECTION_FIELDS

***********************************************************************

FORM BUILD_SELECTION_FIELDS.

IF ZFIRST = 'Y'.

  • PERNR

clear ra_pernr.

refresh ra_pernr.

ra_pernr-sign = 'E'.

ra_pernr-option = 'EQ'.

ra_pernr-low = ZHCM_MERIT_ELIG-PERNR.

append ra_pernr.

  • GSBER

clear ra_gsber.

refresh ra_gsber.

ra_gsber-sign = 'E'.

ra_gsber-option = 'EQ'.

ra_gsber-low = ZHCM_MERIT_ELIG-GSBER.

append ra_gsber.

  • Werks

clear ra_werks.

refresh ra_werks.

ra_werks-sign = 'E'.

ra_werks-option = 'EQ'.

ra_werks-low = ZHCM_MERIT_ELIG-WERKS.

append ra_werks.

ZFIRST = 'N'.

ELSE.

  • PERNR

ra_pernr-low = ZHCM_MERIT_ELIG-PERNR.

append ra_pernr.

clear: ra_pernr-low.

  • GSBER

ra_gsber-low = ZHCM_MERIT_ELIG-GSBER.

append ra_gsber.

clear: ra_gsber-low.

  • Werks

ra_werks-low = ZHCM_MERIT_ELIG-WERKS.

append ra_werks.

clear: ra_werks-low.

ENDIF.

ENDFORM. "BUILD_SELECTION_FIELDS

***********************************************************************

  • SUBMIT_ZPAPAI0026

***********************************************************************

FORM SUBMIT_ZPAPAI0026.

SORT RA_PERNR BY LOW.

SET PARAMETER ID 'PER' FIELD SPACE.

SUBMIT ZPAPAI0026_CREAT_MERT_INCR_ONG

WITH PNPPERNR IN RA_PERNR

  • WITH PNPGSBER IN RA_GSBER

  • WITH PNPWERKS IN RA_WERKS

WITH P_TEST EQ P_TEST

WITH PNPTIMED EQ 'D'.

ENDFORM. "SUBMIT_ZPAPAI0026

9 REPLIES 9
Read only

MarcinPciak
Active Contributor
0 Likes
1,674

I think it is running with parameters you have provided but LDB before starting program, first sorts PERNRs filled in select options. So check if the first picked EE is the first PERNR (in sorted order) in your range RA_PERNR table.

Regards

Marcin

Read only

Former Member
0 Likes
1,674

The first PERNR in RA_PERNR, whcih is sorted before the SUBMIT, is 66235, the first PERNR returned by GET_PERAS is 583.

Read only

0 Likes
1,674

Before the SUBMIT statement, try to clear Parameter id PER


SET PARAMETER ID 'PER' FIELD SPACE.

Then try

a®

Read only

Former Member
0 Likes
1,674

Added the suggested line and ran the program and got the same results.

Read only

0 Likes
1,674

Just tried it myself and worked fine


"-------------------
REPORT z_pnpce1.

TABLES: pernr.
NODES peras.

START-OF-SELECTION.
GET peras.
   "<- here both PERNR and PERAS receive subsequent PERNRs within this range
"-------------------
REPORT z_pnpce2.

DATA ra_pernr TYPE RANGE OF pernr WITH HEADER LINE.

ra_pernr-low = '40025941'.
ra_pernr-high = '40026000'.
ra_pernr-sign = 'I'.
ra_pernr-option = 'BT'.
APPEND ra_pernr.

SUBMIT z_pnpce1
WITH pnppernr IN ra_pernr
WITH PNPTIMED EQ 'D'.

Check it once again

Regards

Marcin

Read only

Former Member
0 Likes
1,675

Still no luck. I am not using the LDP in the triggering program if that makes any difference.

Here is most of the program:

RANGES:

RA_GSBER FOR ZHCM_MERIT_ELIG-GSBER,

RA_WERKS FOR ZHCM_MERIT_ELIG-WERKS.

DATA: RA_PERNR TYPE RANGE OF PERNR WITH HEADER LINE.

**********

*INITIALIZATON

**********

INITIALIZATION.

gc_page_title = Text-001.

SET CURSOR FIELD 'P_RDATE'.

****************************************************************************************

    • S T A R T O F S E L E C T I O N

****************************************************************************************

start-of-selection.

SELECT SINGLE * FROM T549Q

WHERE BEGDA <= P_RDATE

AND ENDDA >= P_RDATE

AND PERMO = '04'.

IF SY-SUBRC = 0.

ZBEGDA = T549Q-BEGDA - 28.

ENDIF.

CLEAR: WA_RPT_REC.

ZSKIP = 'N'.

SELECT * FROM ZHCM_MERIT_ELIG

WHERE PERNR IN S_PERNR

AND GSBER IN S_GSBER

AND WERKS IN S_WERKS

AND ( ELIGIBLE = 'X' OR NOT_ELIGIBLE = 'X' )

AND BEGDA >= ZBEGDA

AND BEGDA <= P_RDATE.

ZRECS_READ = ZRECS_READ + 1.

PERFORM INSERT_RPT_REC.

IF ZRECS_READ = P_BCNT.

PERFORM SUBMIT_ZPAPAI0026.

CLEAR: RA_PERNR,

RA_GSBER,

RA_WERKS.

REFRESH:RA_PERNR,

RA_GSBER,

RA_WERKS.

ZFIRST = 'Y'.

ZRECS_READ = 0.

ENDIF.

ZRECS_READ = ZRECS_READ + 1.

PERFORM BUILD_SELECTION_FIELDS.

ENDSELECT.

IF ZRECS_READ > 0.

PERFORM SUBMIT_ZPAPAI0026.

ENDIF.

****************************************************************************************

    • E N D O F S E L E C T I O N

****************************************************************************************

END-OF-SELECTION.

DESCRIBE TABLE T_RPT_REC LINES ZLINES.

IF ZLINES = 0.

MESSAGE I099 WITH 'NO MERIT INCREASE RECORDS CREATED'.

ELSE.

PERFORM DISPLAY_EMPLOYEE USING T_RPT_REC

ZBEGDA

P_RDATE

'MERIT INCREASE SPILTTER REPORT'.

ENDIF.

***********************************************************************

  • BUILD_SELECTION_FIELDS

***********************************************************************

FORM BUILD_SELECTION_FIELDS.

IF ZFIRST = 'Y'.

  • PERNR

clear ra_pernr.

refresh ra_pernr.

ra_pernr-sign = 'E'.

ra_pernr-option = 'EQ'.

ra_pernr-low = ZHCM_MERIT_ELIG-PERNR.

append ra_pernr.

  • GSBER

clear ra_gsber.

refresh ra_gsber.

ra_gsber-sign = 'E'.

ra_gsber-option = 'EQ'.

ra_gsber-low = ZHCM_MERIT_ELIG-GSBER.

append ra_gsber.

  • Werks

clear ra_werks.

refresh ra_werks.

ra_werks-sign = 'E'.

ra_werks-option = 'EQ'.

ra_werks-low = ZHCM_MERIT_ELIG-WERKS.

append ra_werks.

ZFIRST = 'N'.

ELSE.

  • PERNR

ra_pernr-low = ZHCM_MERIT_ELIG-PERNR.

append ra_pernr.

clear: ra_pernr-low.

  • GSBER

ra_gsber-low = ZHCM_MERIT_ELIG-GSBER.

append ra_gsber.

clear: ra_gsber-low.

  • Werks

ra_werks-low = ZHCM_MERIT_ELIG-WERKS.

append ra_werks.

clear: ra_werks-low.

ENDIF.

ENDFORM. "BUILD_SELECTION_FIELDS

***********************************************************************

  • SUBMIT_ZPAPAI0026

***********************************************************************

FORM SUBMIT_ZPAPAI0026.

SORT RA_PERNR BY LOW.

SET PARAMETER ID 'PER' FIELD SPACE.

SUBMIT ZPAPAI0026_CREAT_MERT_INCR_ONG

WITH PNPPERNR IN RA_PERNR

  • WITH PNPGSBER IN RA_GSBER

  • WITH PNPWERKS IN RA_WERKS

WITH P_TEST EQ P_TEST

WITH PNPTIMED EQ 'D'.

ENDFORM. "SUBMIT_ZPAPAI0026

Read only

0 Likes
1,674

Do you want EEs other than the ones you provide?


ra_pernr-sign = 'E'  "<- this is excluding option so all the others will be picked, not the ones provided in range table
"just change it to 
ra_pernr-sign = 'I'.

Should help

Regards

Marcin

Read only

Former Member
0 Likes
1,674

The stupid mistakes get you every time, as does not being able to see the forest from the trees.

That solved it. Thanks for the help.

Read only

0 Likes
1,674

The stupid mistakes get you every time, as does not being able to see the forest from the trees.

Absolutely, these are the most dangerous and will likely turn your hair grey