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

Dynamic structure to create

Former Member
0 Likes
629

Hi,

I have text which is created on SO10. I have declaration part on this element.

LOOP AT lt_tline INTO ls_tline.

....

ELSEIF ls_tline-tdline CS text-009. "text-009 contains 'Declaration'

PERFORM f_offset_text USING ls_tline-tdline

CHANGING gs_declaration-declaration.

This means after user write 'Declaration', he can write anything and this can contain more than one row so

BASICALLY PROBLEM BEGINS HERE...

because if user write two rows, I need structure that contains two fields and if user write three rows, I need structure structure that contains three fields.

I NEED STRUCTURE TO SEND EASILY TO SMARTFORM

4 REPLIES 4
Read only

Former Member
0 Likes
577

why wont u use Internal table?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
577

>

> I have text which is created on SO10. I have declaration part on this element.

>

> LOOP AT lt_tline INTO ls_tline.

> ....

> ELSEIF ls_tline-tdline CS text-009. "text-009 contains 'Declaration'

> PERFORM f_offset_text USING ls_tline-tdline

> CHANGING gs_declaration-declaration.

>

> This means after user write 'Declaration', he can write anything and this can contain more than one row so

>

> I NEED STRUCTURE TO SEND EASILY TO SMARTFORM

I'm not sure what exactly you're trying to do here. Anyway if you want to pass the SO10 text to the smartform, you can use the "Include Text" type instead of coding for it.

BR,

Suhas

PS: You can specify dynamic texts as well !

Read only

Former Member
0 Likes
577

CALL METHOD cl_alv_table_create=>create_dynamic_table

Read only

Former Member
0 Likes
577

Similar to ur requirement i also had a requirement where user can edit the standard text in the provided edior screen in the selection screen and that text has to be passed to the form.

i used...

to display the standard text in the screen

CALL METHOD G_CUSTOM->SET_TEXT_AS_R3TABLE

EXPORTING

TABLE = TEXTLINES

EXCEPTIONS

OTHERS = 1.

Once the user modified to get the details

CALL METHOD G_CUSTOM->GET_TEXT_AS_R3TABLE

IMPORTING

TABLE = TEXTLINES

EXCEPTIONS

OTHERS = 1.

and just save it in the dummy text. eg concatenate the SO10 text name_dummy. to create the dummy text following code.

LOOP AT TEXTLINES INTO W_TEXT.

W_LINE-TDFORMAT = '*'.

W_LINE-TDLINE = W_TEXT.

APPEND W_LINE TO T_LINE.

CLEAR W_LINE.

ENDLOOP.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = G_TDID

FLANGUAGE = G_SPRAS

FNAME = G_TDNAME

FOBJECT = G_TDOBJ

TABLES

FLINES = T_LINE

EXCEPTIONS

NO_INIT = 1

NO_SAVE = 2

OTHERS = 3 .

pass this dummy text name to the smart form and once the smart form exceuted successfully just delete the dummy text

CALL FUNCTION 'DELETE_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = G_TDID

LANGUAGE = G_SPRAS

NAME = G_TDNAME

OBJECT = G_TDOBJ

  • SAVEMODE_DIRECT = ' '

  • TEXTMEMORY_ONLY = ' '

  • LOCAL_CAT = ' '

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2 .

Hope it will give some idea

regards,

Mullai