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

ranges doubt

Former Member
0 Likes
596

Dear EXperts,

In the below code i am capturing all the pernr values in ranges if the same i pass in perform headcunt changing r_pernr. it's saying that r_pernr is not an internal table.

LOOP AT IT_PB4000 INTO WA_PB4000 WHERE ENDDA EQ '99991231' AND BEGDA BETWEEN LV_LWFD AND LV_LWED AND APSTA EQ 7.

LV_HC = LV_HC + 1.

RANGES : R_PERNR FOR WA_PB4000-PERNR.

IF IT_PB4000 IS NOT INITIAL.

R_PERNR-SIGN = 'I'.

R_PERNR-OPTION = 'EQ'.

R_PERNR-LOW = WA_PB4000-PERNR.

APPEND R_PERNR.

it_range[] = r_pernr[].

endif.

ENDLOOP.

MOVE LV_HC TO WA_OUTPUT-PWEEK.

CLEAR : LV_HC.

is there anyother way to capture all the pernr values and these values i have to pass in perform statements

thanks,

Thiru. R

Edited by: thirukumaran rajendran on Dec 31, 2008 10:33 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
563

hi

use tables instead of changing.

example

PERFORM get_bsis TABLES gt_bsis

s_arecon

r_apar.

FORM get_bsis TABLES p_tab STRUCTURE bsis

p_select STRUCTURE r_glrange

p_range STRUCTURE r_glrange.

SELECT * FROM bsis

INTO TABLE p_tab

WHERE bukrs IN s_bukrs

AND hkont IN p_range

AND gjahr IN s_year

AND monat IN s_period

AND vbund NE ' '.

ENDFORM. "get_bsis

reg

Ramya .

It works.

Dear EXperts,

In the below code i am capturing all the pernr values in ranges if the same i pass in perform headcunt changing r_pernr. it's saying that r_pernr is not an internal table.

LOOP AT IT_PB4000 INTO WA_PB4000 WHERE ENDDA EQ '99991231' AND BEGDA BETWEEN LV_LWFD AND LV_LWED AND APSTA EQ 7.

LV_HC = LV_HC + 1.

RANGES : R_PERNR FOR WA_PB4000-PERNR.

IF IT_PB4000 IS NOT INITIAL.

R_PERNR-SIGN = 'I'.

R_PERNR-OPTION = 'EQ'.

R_PERNR-LOW = WA_PB4000-PERNR.

APPEND R_PERNR.

it_range[] = r_pernr[].

endif.

ENDLOOP.

MOVE LV_HC TO WA_OUTPUT-PWEEK.

CLEAR : LV_HC.

is there anyother way to capture all the pernr values and these values i have to pass in perform statements

thanks,

Thiru. R

Edited by: thirukumaran rajendran on Dec 31, 2008 10:33 AM

3 REPLIES 3
Read only

Former Member
0 Likes
564

hi

use tables instead of changing.

example

PERFORM get_bsis TABLES gt_bsis

s_arecon

r_apar.

FORM get_bsis TABLES p_tab STRUCTURE bsis

p_select STRUCTURE r_glrange

p_range STRUCTURE r_glrange.

SELECT * FROM bsis

INTO TABLE p_tab

WHERE bukrs IN s_bukrs

AND hkont IN p_range

AND gjahr IN s_year

AND monat IN s_period

AND vbund NE ' '.

ENDFORM. "get_bsis

reg

Ramya .

It works.

Read only

Former Member
0 Likes
563

declare ur range like


data : R_PERNR type range of WA_PB4000-PERNR. "ranges is obsolete
data: l_wa_range like line of r_pernr.

"use append like
append l_wa_range to r_pernr.
 now loop at r_pernr and copy into it_range or directly assign l_wa_range to it_range.

кu03B1ятu03B9к

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
563

Hello Thiru. R,

The declaration RANGES is a obsolete stmt. Plz try this declaration, it will work.


TYPES: TY_R_PERNR RANGE OF PERNR.

DATA: 

R_PERNR TYPE TY_R_PERNR,
WA_R_PERNR TYPE LINE OF TY_R_PERNR.

And modify the code accordingly:


WA_R_PERNR-SIGN = 'I'.
WA_R_PERNR-OPTION = 'EQ'.
WA_R_PERNR-LOW = WA_PB4000-PERNR.
APPEND WA_R_PERNR TO R_PERNR.

You can pass R_PERNR as changing parameter as well.


perform headcunt 
changing r_pernr type TY_R_PERNR.

Hope this helps.

BR,

Suhas

Edited by: Suhas Saha on Dec 31, 2008 10:43 AM