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: 

Use of structure in handling repetitve structure

Former Member
0 Kudos

Hi!,

I have a problem with read/modify the repetitve structure. I feel that to read/modify the repetitve structure I cant use just a new structure as the structure will hold only one record. To hold more than one record I will have to use a stru/table. how should I proceed. For example, if my infotyp is IT0812 for KR, and I will have handle the structure HCMT_BSP_PA_KR_R0812 and repetitive structure HCMT_BSP_PA_KR_R0812_LIN_A, ie to read/modify the field from both rep as well as non rep struc.

-- R C Naveen

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi naveen,

1. I am not sure if i understood ur question properly.

2. In infotype 0812, table pa0812, there is only one sequence of repeat structure.

3. U can declare a new structure (if not available),

for the fields

SUB01

OBJ01

NUM01

NAM01

CNT01

AMT01

CUR01

4. Then u can use DO.. VARYING syntax for the same.

regards,

amit m.

4 REPLIES 4

Former Member
0 Kudos

Hi naveen,

1. I am not sure if i understood ur question properly.

2. In infotype 0812, table pa0812, there is only one sequence of repeat structure.

3. U can declare a new structure (if not available),

for the fields

SUB01

OBJ01

NUM01

NAM01

CNT01

AMT01

CUR01

4. Then u can use DO.. VARYING syntax for the same.

regards,

amit m.

Former Member
0 Kudos

Tx Amit,

But there are around 18 sequence like (PS0812)

SUB01, SUB02,....,SUB18

OBJ01,OBJ02,....OBJ18,

.....

.....

Now how can I use only one structure to handle all these.

I am designing front end for the portal, with webdynpro, to read/modify this infotpe. Now I need to create function modules at the backend to read/modify this IT. In the front end the user will enter the data for the repetitve structure. But if I use a single sructure to read the data, only one single record will be read. But the input would be like a table.

So please could you suggest me a method to read the whole table at a time.

0 Kudos

I guess you can use multiple performs and one form routine :

see the simple example :

PERFORM write_2_server TABLES hire_emp_tab.

PERFORM write_2_server TABLES entrance_tab.

PERFORM write_2_server TABLES integration_tab.

PERFORM write_2_server TABLES duty_tab .

PERFORM write_2_server TABLES type_emp_tab.

PERFORM write_2_server TABLES job_part_tab .

PERFORM write_2_server TABLES free_days_tab.

PERFORM write_2_server TABLES status_tab.

PERFORM write_2_server TABLES bank_detailes_tab.

FORM write_2_server TABLES p_tab_data.

FIELD-SYMBOLS: <wa> TYPE ANY.

" MOVE 'D:_pa_test_mmsk_pa1.txt' TO adress.

OPEN DATASET adress IN TEXT MODE

ENCODING DEFAULT FOR OUTPUT.

IF sy-subrc = 0.

no_file = ' '.

LOOP AT p_tab_data ASSIGNING <wa>.

TRANSFER <wa> TO adress.

ENDLOOP.

CLOSE DATASET adress.

ELSE.

no_file = 'X'.

ENDIF.

endform.

Thanks

Seshu

Former Member
0 Kudos

TX Seshu,

But do I have to use FORM-PERFORM statement (subroutine). Cant I do it using any other method???