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 with Ranges in a structure

venkatasap
Participant
0 Likes
1,573

Hi SapAll.

i have a requirement to do a development in SAP-GTS(Global Trade services),the requirement is i have to create a Zprogram where i need to call and assign values to the structure of a sap stadnard Function Module'/SAPSLL/CON_BLOCK_DOCS_SELECT' .but this structure of the FM is having all the components of type 'Ranges table type'.so here i want to know on how i can assign values to these Rnages table type components.

i have defined some work areas as below

for a component->i have doube clicked on the component->then it directed me to respective Ranges table type->i have copied Structured Row Type and defined as below

wa_stcon TYPE /SAPSLL/STCOS_R_S,

t_stcon LIKE STANDARD TABLE OF wa_stcon with header line,.

t_stcon-SIGN = 'I'.

t_stcon-OPTION = 'EQ'.

t_stcon-LOW = '1A'.

t_stcon-HIGH = ''.

APPEND t_stcon.

here my question is how i can assign the values of t_stcon to the structure (one level above).

waiting for good solution to implement.

regards.

Varma

Hi SapAll.

i have a requirement to do a development in SAP-GTS(Global Trade services),the requirement is i have to create a Zprogram where i need to call and assign values to the structure of a sap stadnard Function Module'/SAPSLL/CON_BLOCK_DOCS_SELECT' .but this structure of the FM is having all the components of type 'Ranges table type'.so here i want to know on how i can assign values to these Rnages table type components.

i have defined some work areas as below

for a component->i have doube clicked on the component->then it directed me to respective Ranges table type->i have copied Structured Row Type and defined as below

wa_stcon TYPE /SAPSLL/STCOS_R_S,

t_stcon LIKE STANDARD TABLE OF wa_stcon with header line,.

t_stcon-SIGN = 'I'.

t_stcon-OPTION = 'EQ'.

t_stcon-LOW = '1A'.

t_stcon-HIGH = ''.

APPEND t_stcon.

here my question is how i can assign the values of t_stcon to the structure (one level above).

waiting for good solution to implement.

regards.

Varma

8 REPLIES 8
Read only

rainer_hbenthal
Active Contributor
0 Likes
1,538

Maybe the compiler is struggling because he is exporting the structure to the FM and not the table. Try to add [] to the exporting value, this clearly states that you are passing the table, not the work area.

Read only

0 Likes
1,538

Hi Verma,

Do it this way, it should work!!

DATA: wa TYPE /sapsll/blocked_status_crit_s.

DATA: t_stcon TYPE /sapsll/stcos_r_t WITH HEADER LINE.

t_stcon-sign = 'I'.

t_stcon-option = 'EQ'.

t_stcon-low = '1A'.

t_stcon-high = ''.

APPEND t_stcon.

wa-stcon_agg = t_stcon[].

CALL FUNCTION '/SAPSLL/CON_BLOCK_DOCS_SELECT'

EXPORTING

  • IS_CUHD_CRIT =

  • IS_CORREF_CRIT =

is_status_crit = wa

  • IS_VBS_CRIT =

  • IV_CD = 'X'

  • IV_CSD = ' '

  • IS_DEBUG =

  • IV_PRODUCT =

  • IV_CMREL = ' '

  • IMPORTING

  • ET_HEADER =

  • ET_ITEM =

EXCEPTIONS

no_data_found = 1

no_data_authority = 2

OTHERS = 3

Regards,

Srikanth

Read only

0 Likes
1,538

Hi Mr Srikanth.

the Issue was solved with the statement 't_status-stldt_agg = t_stldt[].' but i have got another issue with the other component.

the structure of the component in the SAP Function Module is as follows :

PARAMETERNAME : IR_LGREG,Associated type :/SAPSLL/LGREG_R_T(Ranges table type->data element as /SAPSLL/LGREG->Structured Row Type(/SAPSLL/LGREG_R_S).

the Source code in the ZPROGRAM is as below :

wa_lgreg TYPE /sapsll/lgreg_r_s,

t_lgreg LIKE STANDARD TABLE OF wa_lgreg WITH HEADER LINE,

t_lgreg-sign = 'i'.

t_lgreg-option = 'EQ'.

t_lgreg-low = 'AOCPR'.

APPEND t_lgreg.

CALL FUNCTION '/SAPSLL/CON_BLOCK_DOCS_SELECT'

EXPORTING

  • IS_CUHD_CRIT =

  • IS_CORREF_CRIT =

  • IS_STATUS_CRIT =

is_cuit_crit = t_status

  • IS_VBS_CRIT =

ir_lgreg = t_lgreg

When i ran the program iam getting the Runtime error is as folows :

Short text

Type conflict when calling a function module.

What happened?

The current ABAP program "ZRECHECKDOCU_LICENSEUPD" had to be terminated because

it has

come across a statement that unfortunately cannot be executed.

A function module was called incorrectly.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught and

therefore caused a runtime error.

The reason for the exception is:

The call to the function module "/SAPSLL/CON_BLOCK_DOCS_SELECT" is incorrect:

The function module interface allows you to specify only

fields of a particular type under "IR_LGREG".

The field "T_LGREG" specified here is a different

field type

waiting for your response.

regards.

Varma.

Read only

0 Likes
1,538

Hi Srikanth.

i didnt get any response from you on my previous question,does my question not make any sense to you.if you dont understand my question i will again explain that in brief.

regards.

Varma

Read only

0 Likes
1,538

Hi,

The runtime error clearly tells you that there is a mismatch between the datatype of fields ir_lgreg and t_lgreg.

t_lgreg is the internal table with header line. So, you will have to write it as,


ir_lgreg = t_lgreg[]

Regards,

Danish.

Read only

0 Likes
1,538

Hi Varma,

Sorry for the dealy, was bit busy with other work..

I am unable to see that paramater you mentioned in the function module??

FM /SAPSLL/CON_BLOCK_DOCS_SELECT has just these below importing paramaters

IS_CUHD_CRIT TYPE /SAPSLL/CUHD_CRIT_S

IS_CORREF_CRIT TYPE /SAPSLL/CORREF_CRIT_S

IS_STATUS_CRIT TYPE /SAPSLL/BLOCKED_STATUS_CRIT_S

IS_VBS_CRIT TYPE /SAPSLL/GUID_16_R_T

IV_CD TYPE 'X' XFELD

IV_CSD TYPE SPACE XFELD

IS_DEBUG TYPE /SAPSLL/DEBUG_S

IV_PRODUCT TYPE /SAPSLL/PROD_REQ

IV_CMREL TYPE ' ' /SAPSLL/CMREL

can you please copy and paste the type of paramater(IR_LGREG) from the FM..

and try this once

wa_lgreg TYPE /sapsll/lgreg_r_s,

t_lgreg TYPE /SAPSLL/LGREG_R_T WITH HEADER LINE,

t_lgreg-sign = 'i'.

t_lgreg-option = 'EQ'.

t_lgreg-low = 'AOCPR'.

APPEND t_lgreg.

CALL FUNCTION '/SAPSLL/CON_BLOCK_DOCS_SELECT'

EXPORTING

  • IS_CUHD_CRIT =

  • IS_CORREF_CRIT =

  • IS_STATUS_CRIT =

is_cuit_crit = t_status

  • IS_VBS_CRIT =

ir_lgreg = t_lgreg[]

Regards,

Srikanth

Read only

0 Likes
1,538

Hi Danish.

i did changed as you said and its working .thank you

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,538

Don't have this module, but I guess the following codes shoul help you

* just define the work area (of a field symbol)
DATA: wa_stcon TYPE /sapsll/stcos_r_s.
wa_stcon-sign = 'I'.
wa_stcon-option = 'EQ'.
wa_stcon-low = '1A'.
wa_stcon-high = ''.
APPEND wa_stcon TO structurename-component.
* or fill an itab and
structurename-omponent = t_stcon[].

Regards,

Raymond