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

Problem while executing a program in BW

srinivas_anilkumar
Active Contributor
0 Likes
1,309

Dear Experts,

I have a Z program in BW that is getting canclled when I am trying to run it. The error message is as below

´Selection criterion "0PCALMON" contains an invalid selection line´

Detailed message is below

Diagnosis

Although selections exist for the selection criterion "0PCALMON", they can be processed neither on the selection screen nor on the 'Multiple selection' screen because of restrictions in the application program. The line in question has the sign "BT" (field SIGN) which is not allowed on the main selection screen. 'Multiple selection' is not allowed for 0PCALMON.

There is probably an error in the application program.

Any clues on this. I checked the program and I found something below where I think it is terminating.

¨it_varcontent-selname = '0PCALMON'.

it_varcontent-kind = 'S'.

it_varcontent-sign = 'I'.

it_varcontent-option = 'BT'.

CONCATENATE buper '.' gjahr INTO it_varcontent-low.

CONCATENATE buper '.' gjahr INTO it_varcontent-high.

APPEND it_varcontent.

Could some one please help me in solving this.

The parameters we are passing to run this program is period : 04.2008, Variant Name and Company Code.

Thanks and Regards,

Srini

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,091

Are you referring to InfoObject 0CALMONTH? In my system it is defined as NUMC6, and the data format would be YYYYMM.

Both your format and length may be incorrect.

9 REPLIES 9
Read only

Former Member
0 Likes
1,092

Are you referring to InfoObject 0CALMONTH? In my system it is defined as NUMC6, and the data format would be YYYYMM.

Both your format and length may be incorrect.

Read only

0 Likes
1,091

Dear Jerry,

Thanks for the reply.

As I understand form the program, we are just getting the period from the date ( DATE_TO_PERIOD_CONVERT) and then deleting the left 0 to make it to 2 digits along with the year.

And then we have the program as below

CLEAR it_varcontent.

REFRESH it_varcontent.

it_varcontent-selname = '8GLBSETD'.

it_varcontent-kind = 'P'.

it_varcontent-low = ' D/M/YYYY HH:MM:SS'.

APPEND it_varcontent.

it_varcontent-selname = '0PCALMON'.

it_varcontent-kind = 'S'.

it_varcontent-sign = 'I'.

it_varcontent-option = 'BT'.

CONCATENATE buper '.' gjahr INTO it_varcontent-low.

CONCATENATE buper '.' gjahr INTO it_varcontent-high.

+APPEND it_varcontent

Can you please tell me what is this line it_varcontent-option = 'BT'. used for?

Thanks and Regards,

Srini

Read only

0 Likes
1,091

You are populating a "range". The BT means "between". So you are asking to return rows that are between it_varcontent-low and it_varcontent-high.

The "I" means include. You could also have an "E" for exclude.

Read only

0 Likes
1,091

Dear Jerry,

Could you please tell me if the BT is causing the problem here. As seen in the program,

CONCATENATE buper '.' gjahr INTO it_varcontent-low.

CONCATENATE buper '.' gjahr INTO it_varcontent-high.

we are concatenating the period with the year hence making 04.2008 as Low and 04.2008 as high in this case.

Any suggestions why the program geting terminated at the OPCALMON?

Thanks and Regards,

Srini

Read only

0 Likes
1,091

Sorry. I wasn't very clear. I am thinking you should try to reverse the year/month, and remove the period.

E.g.

CONCATENATE gjahr buper INTO it_varcontent-low.
CONCATENATE gjahr buper INTO it_varcontent-high.

Let me know how you make out.

Read only

0 Likes
1,091

Dear Jerry,

I will try that, Before that, I just checked that the OPCALMON length defined as 8 when I tried to debug the program. where as the buper field ( period), the leading zeros are deleted which makes it as 4 ( for period 004) and the gjahr (year) as 2008 which makes it as 4.2008

Same case with high value as well.

Does the OPCALMON field length of 8 is causing the problem here as the system is trying to put only 6 chars length i.e 4.2008 while executing the program?

hope I made my self clear here.

Thanks and Regards,

Srini

Read only

0 Likes
1,091

What InfoObject is OPCALMON ? Usually, periods are defined as 3 bytes, and months are always 2.

I don't think you'd ever put a period in data.

We'll need to know more about how the target field is defined.

Read only

0 Likes
1,091

Dear Jerry,

Yes normall periods should be defined as 3 bytes where as here user expecting it to have 2 bytes by deleting the leading zeros in the left.

Could you please let me know, if I have to delete only 1 leading zero from 004.2008 to make it to 04.2008. how would I write the statement like?

Here in the program it is defined as

SHIFT buper LEFT DELETING LEADING '0'

which i think it will delete all the leading zeros in the left.

Any suggestion on the statement.

Thanks and Regards

Srini

Read only

srinivas_anilkumar
Active Contributor
0 Likes
1,091

The problem indeed was the Option. It should be EQ rather than BT. and I removed the high value as we have only a single entry for OPCALMON.

Thanks and Regards,

Srini