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

Mass Variant change program

Former Member
0 Likes
3,935

Hello all,

I have created one program for mass changing variant values.

I am using FM RS_VARIANT_CONTENTS for fetching variant details and then FM RS_CHANGE_CREATED_VARIANT for changing variant values.

I have one issue in updating the date field values

If any screen have a date field then from FM RS_VARIANT_CONTENTS,in table valutab date value is coming in MM/DD/YYYY format.When I pass this to FM RS_CHANGE_CREATED_VARIANT then date get saved in some incorrect format(like //12//).

I know i have to change the date format to YYYYMMDD format before updating..but the issue is my program name is dyanamic and I do not know which field is of date type.

Is there any way to identify the data type of the field while reading variants?

Thanks in advance.

regards,

Lokesh

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,201

Check function RS_VARIANT_VALUES_TECH_DATA instead of RS_VARIANT_CONTENTS

If you are using RS_VARIANT_CONTENTS there is a parameter MOVE_OR_WRITE

The documentation says

The MOVE_OR_WRITE parameter determines in which format the values are output (concerns mainly date fields).

Example: MOVE_OR_WRITE = 'W' => Date in the form dd.mm.yyyy (depending on profile)

MOVE_OR_WRITE = 'M' => Date in the form yyyymmdd

By default its W so change it to M

Hope it helps

7 REPLIES 7
Read only

Former Member
0 Likes
2,201

You can use function GET_GLOBAL_SYMBOLS. You can restrict the output by program name and selection screen field name. Among other things this function returns the data type of the field in the table FIELDLIST column TYPE

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,202

Check function RS_VARIANT_VALUES_TECH_DATA instead of RS_VARIANT_CONTENTS

If you are using RS_VARIANT_CONTENTS there is a parameter MOVE_OR_WRITE

The documentation says

The MOVE_OR_WRITE parameter determines in which format the values are output (concerns mainly date fields).

Example: MOVE_OR_WRITE = 'W' => Date in the form dd.mm.yyyy (depending on profile)

MOVE_OR_WRITE = 'M' => Date in the form yyyymmdd

By default its W so change it to M

Hope it helps

Read only

0 Likes
2,201

Thanks Keshav for your solution

Read only

0 Likes
2,201

Hello all,

I had used FM RS_CHANGE_CREATED_VARIANT to modify variant values.

I found one strange issue:

Support one variant have two fields (field_1 and field_2)

field_1 S (blank)

Field_2 S I EQ value_low

Now suppose I want to fil onlyl field_1, then the above FM is not updating the value.

However when I tried modifying both field_1 and fied_2 then the values get modified.

Can anyone explain why is it happening?

regards,

Lokesh

Read only

former_member585060
Active Contributor
0 Likes
2,201

Hi,

Before reading the variant values of a program use the function module 'RS_REPORTSELECTIONS_INFO', just pass the report name in REPORT paramater, the function module will return the selection screen fields info in table FIELD_INFO, you can get each field data type in this table.

Thanks & Regards

Bala Krishna P

Read only

Former Member
0 Likes
2,201

One issue came while modifying the value.

Read only

Former Member
0 Likes
2,201

I used commit while modifying