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

Creating a dynamic variant

Former Member
0 Likes
328

Hi,

Iam using the following two function modules to craete a dynamic variant.

  • This function module selects the Selection Screen contents

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

EXPORTING

curr_report = sy-repid

TABLES

selection_table = loc_int_tab

EXCEPTIONS

not_found = 1

no_report = 2

OTHERS = 3.

IF sy-subrc NE 0.

MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).

LEAVE LIST-PROCESSING.

ENDIF.

  • Craete the variant VAR1

CALL FUNCTION 'RS_CREATE_VARIANT'

EXPORTING

curr_report = sy-repid

curr_variant = wf_variant

vari_desc = loc_varid

TABLES

vari_contents = loc_int_tab

vari_text = loc_varit

EXCEPTIONS

illegal_report_or_variant = 1

illegal_variantname = 2

not_authorized = 3

not_executed = 4

report_not_existent = 5

report_not_supplied = 6

variant_exists = 7

variant_locked = 8

OTHERS = 9.

IF sy-subrc <> 0.

MESSAGE i000 WITH 'Error while creating dynamic variant'(028).

LEAVE LIST-PROCESSING.

ENDIF.

Now my problem is I have one parameter 'filename' on selection screen which is of 255 characters lenth , but the internal table loc_int_tab in above function modules can hold up to 45 characters only. But I want to store all the 255 characters in it.

Have you ever comeacross with this problem"

Or do we have any other function modules which will sove the purpose.

Thanks in advance,

Brahma Reddy

1 REPLY 1
Read only

Former Member
0 Likes
276

split the file path lenghth into diffrent lines ,

say each line has 45 charcters

use fm split the lines into number of charcter

fm is SWA_SPLIT_STRING - here pass ur file path ,length 45 and internal table

internal table output will have diffrent lines,other program is going to concatenate all the lines into one line.