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

Error: Value table for IN itab operator has an unexpected format.

Former Member
0 Likes
4,580

Hi Geeks,

I have to create a wrapper report program in which i have to call the custom function module.

But while executing it , I am getting dump which says: 'Value table for IN itab operator has an unexpected format'.

Following is my program.

report  z_wrapper_read_impact_lines.

data:  ls_status type zst_status,

        ls_entry_date type zst_entry_date,

        ls_job_quoteid type zst_jq_number_range,

        ls_shipto type  zst_ship_to_codes,

        ls_soldto type zst_sold_to_codes,

        ls_sales type  zsales_group,

        lt_zimpact type table of zimpact_quotes,

        ls_bapireturn type fmfg_t_bapireturn.

data: shipto_region type regio,

         shipto_country type land1_gp.

selection-screen : begin of block b1 with frame title text-001.

select-options status for ls_status.

select-options entrydat for ls_entry_date.

select-options job_qid for ls_job_quoteid.

select-options ship_to for ls_shipto.

select-options sold_to for ls_soldto.

select-options sales for ls_sales.

selection-screen : end of block b1.

call function 'Z_READ_IMPACT_LINES'

exporting

   iv_flag                  = 'X'

importing

   ship_to_region           = shipto_region

   ship_to_country          = shipto_country

  tables

   it_status                = status[]

   it_entry_date            = entrydat[]

   it_jq_number_range       = job_qid[]

   it_ship_to_codes         = ship_to[]

   it_sold_to_codes         = sold_to[]

   it_sales_group           = sales[]

    et_bapireturn           = ls_bapireturn[]

    et_zimpact_quotes        = lt_zimpact

          .

Please help me out where I am going wrong.

Thanks,

Somya Sharma

17 REPLIES 17
Read only

Former Member
0 Likes
3,538

Can you post the top portion of the dump?

Rob

Read only

0 Likes
3,538

Hi Rob,

The dump says:

Category               ABAP Programming Error

Runtime Errors         SAPSQL_IN_ITAB_ILL_STRUCTURE

ABAP Program           SAPLZIMPACT_ORDER_PROCESS

Application Component  Not Assigned

Date and Time          04/08/2015 08:32:19

Short text

     Value table for IN itab operator has an unexpected format.

What happened?

     Error in the ABAP Application Program

     The current ABAP program "SAPLZIMPACT_ORDER_PROCESS" had to be terminated

      because it has

     come across a statement that unfortunately cannot be executed.

Thanks,

Somya Sharma

Read only

0 Likes
3,538

So it's dumping in the FM, not your program. Can you post the code where the dump occurs?

Rob

Read only

Former Member
0 Likes
3,538

Hi,

Dump is in Function Module not in Program.

Please post the DUMP, when System Pointing for Error.

Or just paste the complete Dump.

-Regards

Rohit

Read only

0 Likes
3,538

Please do not post the entire dump.

Rob

Read only

0 Likes
3,538

Hi,

You were right. The problem is in the function module. Its giving the same dump when exceuted independently. Actually its working fine when executed with no values in the selection screen.

but as soon as I give some values, it gives dump.

Regards,

Somya Sharma

Read only

0 Likes
3,538
  • There is something going wrong in your select statement and its 'IN' operator. Please post the relevant code.

Regards,

Philip.

Read only

0 Likes
3,538

Hi,

I am posting the FM which I am trying to call in my report and which is giving dump when I pass any value on selection screen.

function z_read_impact_lines.

  data: lt_zimpact_quotes type table of zimpact_quotes,

        ls_ship_to        type zst_ship_to_codes,

        ls_sold_to        type zst_sold_to_codes,

        lv_kunnr          type kunnr,

        ls_bapireturn     type bapireturn.

  data: ls_ship_to_range     type zst_ship_to_range,

        lt_ship_to_range     type table of zst_ship_to_range,

        ls_sold_to_range     type zst_sold_to_range,

        lt_sold_to_range     type table of zst_sold_to_range.

  loop at it_ship_to_codes  into ls_ship_to.

    select single kunnr from kna1 into lv_kunnr

      where kunnr = ls_ship_to-ship_to.

    if sy-subrc ne 0.

      ls_bapireturn-type = 'E'.

      concatenate 'Ship-To ' ls_ship_to-ship_to ' is invalid.'

      into ls_bapireturn-message.

      append ls_bapireturn to et_bapireturn.

      continue.

    else.

      ls_ship_to_range-sign = 'I'.

      ls_ship_to_range-option = 'EQ'.

      ls_ship_to_range-low = ls_ship_to-ship_to.

      append  ls_ship_to_range to lt_ship_to_range.

      clear ls_ship_to_range.

    endif.

  endloop.

  loop at it_sold_to_codes into ls_sold_to.

    select single kunnr from kna1 into lv_kunnr

      where kunnr = ls_sold_to-sold_to.

    if sy-subrc ne 0.

      ls_bapireturn-type = 'E'.

      concatenate 'Sold-To ' ls_sold_to-sold_to ' is invalid.'

      into ls_bapireturn-message.

      append ls_bapireturn to et_bapireturn.

      continue.

    else.

      ls_sold_to_range-sign = 'I'.

      ls_sold_to_range-option = 'EQ'.

      ls_sold_to_range-low = ls_sold_to-sold_to.

      append  ls_sold_to_range to lt_sold_to_range.

      clear ls_sold_to_range.

    endif.

  endloop.

  if iv_flag is initial.

    select * from zimpact_quotes into table lt_zimpact_quotes

      where status        in it_status

      and   entry_date    in it_entry_date

      and   job_quote_id  in it_jq_number_range

      and   ship_to in lt_ship_to_range

      and   sold_to in lt_sold_to_range

      and   del_ind ne 'X'

      and   sales_group in it_sales_group.

  else.

    select * from zimpact_quotes into table lt_zimpact_quotes

      where status        in it_status

      and   entry_date    in it_entry_date

      and   job_quote_id  in it_jq_number_range

      and   ship_to in lt_ship_to_range

      and   sold_to in lt_sold_to_range

      and   sales_group in it_sales_group.

  endif.

  et_zimpact_quotes[] = lt_zimpact_quotes[].

  loop at et_zimpact_quotes.

    select single name1 into et_zimpact_quotes-sold_to_name from kna1

       where kunnr = et_zimpact_quotes-sold_to.

    select single land1 regio name1 into

          (et_zimpact_quotes-ship_to_country,

           et_zimpact_quotes-ship_to_region,

           et_zimpact_quotes-ship_to_name)  from kna1

           where kunnr = et_zimpact_quotes-ship_to.

    select single bstnk audat angdt bnddt into

          (et_zimpact_quotes-job_name,

           et_zimpact_quotes-quote_date,

           et_zimpact_quotes-valid_from,

           et_zimpact_quotes-valid_to)

           from vbak

           where vbeln = et_zimpact_quotes-job_quote_id.

    select single arktx netpr netwr werks into

          (et_zimpact_quotes-product_desc,

           et_zimpact_quotes-net_price,

           et_zimpact_quotes-net_value,

           et_zimpact_quotes-plant)

           from vbap

           where vbeln = et_zimpact_quotes-job_quote_id and

            posnr = et_zimpact_quotes-line_item.

    select single dispo into et_zimpact_quotes-planner

      from marc

      where matnr = et_zimpact_quotes-product_id

      and werks = et_zimpact_quotes-plant.

    modify  et_zimpact_quotes index sy-tabix.

  endloop.

endfunction.

Read only

0 Likes
3,538

There is an issue by the way by which you build your 'RANGES'.

      ls_ship_to_range-sign = 'I'.

      ls_ship_to_range-option = 'EQ'.

      ls_ship_to_range-low = ls_ship_to-ship_to.

      append  ls_ship_to_range to lt_ship_to_range.

Here please check the structure ls_ship_to_range has got corresponding fields sign,option,low with the corresponding types. Check the same for other ranges as well.

For reference look into the structure SELOPT in SE11.

Regards,

Philip.

Read only

0 Likes
3,538

How are the types of your Z ranges defined?

Rob

Read only

former_member195431
Participant
0 Likes
3,538

Hello Somya,

Can you please specify which line of the Z* FM is giving this dump. [Capture it from ST22]

Wild guess: - Is there a possibility of a Z* table mentioned as value table for one of the Z* Domain/Data Type, which has a different format of storing information?? E.g. IND instead of IN for Country.

Thanks

Rajit

Read only

Former Member
0 Likes
3,538

Hello Somya,

I think the problem is that you are using a structure for a select-options. Check these one:

zst_status

zst_entry_date

zst_jq_number_range

zsales_group

Example: If you would like to create a select option for a material id, you need just indicate the structure's field, and the program will generate the range automatically.

Select-option: s_mara FOR mara-matnr.

In your case, try this:

Select-option: status FOR ls_status-xxxxxxx (xxxxx - represent the structure's field).

Regards,

Bruno

Read only

Former Member
0 Likes
3,538

Hi,

Issue is with the declaration of Ranges.

  data: ls_ship_to_range     type zst_ship_to_range,

        lt_ship_to_range     type table of zst_ship_to_range,

        ls_sold_to_range     type zst_sold_to_range,

        lt_sold_to_range     type table of zst_sold_to_range.

instead of 'DATA', try to use 'Ranges.

Ex. Ranges : r_ship_to for zimpact_quotes-ship_to.

Please check with this.

-Regards

Rohit

Read only

0 Likes
3,538

Actually, RANGES is an obsolete statement. But since the OP hasn't posted the declarations of the types of those tables, it's impossible to say what the problem is.

Rob

Read only

0 Likes
3,538

Hi,

I am sharing you the screenshot of the structure of zst_status. All the structures are

similar to it.

Read only

0 Likes
3,538

Hy Somya,

You just need declare a variable with this type and associate your select-option at this variable.

Example:

Data: lv_status TYPE j_stat.

SELECT-OPTIONS: r_stat FOR lv_status.

Regards,

Bruno

Read only

0 Likes
3,538

ZST_STATUS as already the structure of a TYPE RANGE itab, but you also defined a variable ls_statis with this type, and a SELECT-OPTIONS on it, so a TYPE RANGE OF TYPE RANGE. Well SQL is right when it refuse to apply...

Regards,

Raymond