Application Development 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: 

SUBMIT + RANGES

former_member182371
Active Contributor
0 Kudos

Hi,

in

program01

i´ve got he following code snipet:

CLEAR R_BUKRS.
REFRESH R_BUKRS.
R_BUKRS-SIGN = 'I'.
R_BUKRS-OPTION = 'EQ'.
R_BUKRS-LOW = 'AC'.
APPEND R_BUKRS.
CLEAR R_BUKRS.

R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '170000'.
R_CTA1-HIGH = '171999'.
APPEND R_CTA1.
CLEAR R_CTA1.

CLEAR R_CTA1.
REFRESH R_CTA1.
R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '520101'.
R_CTA1-HIGH = '520104'.
APPEND R_CTA1.
CLEAR R_CTA1.

R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '572000'.
R_CTA1-HIGH = '572999'.
APPEND R_CTA1.
CLEAR R_CTA1.


CLEAR R_VTO.
REFRESH R_VTO.
R_VTO-SIGN = 'I'.
R_VTO-OPTION = 'BT'.
R_VTO-LOW = S_ZFBDT-LOW.
R_VTO-HIGH = S_ZFBDT-HIGH.
APPEND R_VTO.
CLEAR R_VTO.

SUBMIT program02 USING SELECTION-SCREEN '1000'
WITH S_BUKRS IN R_BUKRS
WITH S_CTA IN R_CTA1
WITH S_VTO IN R_VTO
AND RETURN.



and when i get the result in program02 the selection seems not consider neither:
R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '170000'.
R_CTA1-HIGH = '171999'.
APPEND R_CTA1.
CLEAR R_CTA1.

nor

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '572000'.

R_CTA1-HIGH = '572999'.

APPEND R_CTA1.

CLEAR R_CTA1.

it is as if program02 only took into consideration one of the three values passed to R_CTA1(only the 2nd one).

why is this happening?

Best regards.

1 ACCEPTED SOLUTION

former_member182371
Active Contributor
0 Kudos

Hi Rich,

although i´ve changed the code thus:

CLEAR R_CTA1.

REFRESH R_CTA1.

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '170000'.

R_CTA1-HIGH = '171999'.

APPEND R_CTA1.

CLEAR R_CTA1.

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '520101'.

R_CTA1-HIGH = '520104'.

APPEND R_CTA1.

CLEAR R_CTA1.

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '572000'.

R_CTA1-HIGH = '572999'.

APPEND R_CTA1.

CLEAR R_CTA1.

whithin program02 there´s a select where i use R_CTA1:

SELECT * FROM VBSEGS AS A

join SKAT AS B

on aSAKNR = bSAKNR

into corresponding fields of table i_VBSEGS

WHERE a~BUKRS = p_bukrs

AND a~VALUT in s_VTO

AND a~SAKNR in

s_CTA

AND b~SPRAS = 'S'

and b~KTOPL = 'AC'.

and here the select seems not to consider the three values i´ve passed.

Regards.

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

The statment is BOLD is clearing your internal table. Remove this statement.



R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '170000'.
R_CTA1-HIGH = '171999'.
APPEND R_CTA1.
CLEAR R_CTA1.

CLEAR R_CTA1.
<b>REFRESH R_CTA1.</b>
R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '520101'.
R_CTA1-HIGH = '520104'.
APPEND R_CTA1.
CLEAR R_CTA1.

R_CTA1-SIGN = 'I'.
R_CTA1-OPTION = 'BT'.
R_CTA1-LOW = '572000'.
R_CTA1-HIGH = '572999'.
APPEND R_CTA1.
CLEAR R_CTA1.

Regards,

Rich Heilman

former_member182371
Active Contributor
0 Kudos

Hi Rich,

although i´ve changed the code thus:

CLEAR R_CTA1.

REFRESH R_CTA1.

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '170000'.

R_CTA1-HIGH = '171999'.

APPEND R_CTA1.

CLEAR R_CTA1.

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '520101'.

R_CTA1-HIGH = '520104'.

APPEND R_CTA1.

CLEAR R_CTA1.

R_CTA1-SIGN = 'I'.

R_CTA1-OPTION = 'BT'.

R_CTA1-LOW = '572000'.

R_CTA1-HIGH = '572999'.

APPEND R_CTA1.

CLEAR R_CTA1.

whithin program02 there´s a select where i use R_CTA1:

SELECT * FROM VBSEGS AS A

join SKAT AS B

on aSAKNR = bSAKNR

into corresponding fields of table i_VBSEGS

WHERE a~BUKRS = p_bukrs

AND a~VALUT in s_VTO

AND a~SAKNR in

s_CTA

AND b~SPRAS = 'S'

and b~KTOPL = 'AC'.

and here the select seems not to consider the three values i´ve passed.

Regards.

0 Kudos

Hi,

Does field r_cta1 need a conversion exit ?

So use fm conversion_exit_alpha

Or :

PERFORM ALPHAFORMAT(SAPFS000) USING r_cta1-low r_cta1-low

.

...

Regards Andreas

0 Kudos

Should this ......



WHERE a~BUKRS = p_bukrs

be this.....



WHERE a~BUKRS in s_bukrs

Regards,

Rich Heilman

0 Kudos

I have tested your code..... the values of s_CTA are being passed correctly.

Regards,

Rich Heilman

former_member182371
Active Contributor
0 Kudos

Hi,

if i use:

R_CTA1-LOW = '0000170000'.

R_CTA1-HIGH = '0000171999'.

instead of:

R_CTA1-LOW = '170000'.

R_CTA1-HIGH = '171999'.

The result is correct.

Best regards.

0 Kudos

Please close post and award points according. Thanks.

Regards,

Rich Heilman