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: 

display result for field symbol type any

manish_malakar0316
Active Participant
0 Kudos

Hi everyone,

I have a report where I need to display the value of a field symbol which is of type any. Now the thing is the code which is inside the include program ZMODULAR_BRF_CODE must not be changed.

The value is inside the field-symbol <la_any> and I need to know how to display it in my report. Below is the report:

Inside the include, the code snippet where <la_any> is getting the value is:

I am getting a runtime error that Conversion of type "_YS_I_OUTPUT_" to type "C LENGTH 16" not supported.

Please let me know how to display the value.<text removed by moderator>

Regards

Manish

10 REPLIES 10

matt
Active Contributor

Please note

1) Post questions once only. You posted a the same question an hour after this one - it has been deleted.

2) Your question is urgent only to you. Marking your post as urgent is likely to make it less likely you will get a response as it is often considered to be rather rude

3) Offering rewards is not permitted, and again will make it less likely that you will get a response. You're also likely to get your question down-voted.

4) Post code as text - otherwise it is not searchable. There is a "code" button on the editor for this purpose. Also, code that is in text can be copy pasted into our own systems where we can more easily test.

Matt Billingham

SAP Community Moderator

matt
Active Contributor
0 Kudos

A word of advice it appears you are using an INCLUDE that will be included in other programs. This is a very bad way to modularise programs.

pokrakam
Active Contributor

Hey Matt, you deleted the one I already answered. But it's OK, let that be a lesson for duplicate posting.

matt
Active Contributor

I always delete the later one - sorry for any inconvenience!

former_member582508
Participant
0 Kudos

Hi Mike,

Let me repost my comment here. I actually debugged the code and I am getting the value:

Now all I need to do is display this value using the write statement 😞

I am pasting my end of the code here for your reference.

selection-SCREEN BEGIN OF BLOCK b1 with frame.
parameters: p_fkber TYPE zstr1-e_fkber,
            p_bilkt TYPE zstr1-e_bilkt,
            p_kostl TYPE zstr1-e_kostl,
            p_aufnr TYPE zstr1-e_aufnr,
            p_posnr TYPE char8.
selection-screen END OF block b1.

types: BEGIN OF ty_output,
          i_fkber TYPE zstr1-e_fkber,
          i_kostl TYPE zstr1-e_kostl,
       END OF ty_output.


DATA: lw_zstr1 TYPE zstr1,
      lw_output TYPE ty_output,
      w_dref TYPE REF TO data.
field-SYMBOLS: <wa_tab> TYPE ty_output.

lw_zstr1-e_fkber = P_FKBER.
lw_zstr1-e_bilkt = P_bilkt.
lw_zstr1-e_kostl = P_kostl.
lw_zstr1-e_aufnr = P_aufnr.
lw_zstr1-e_posnr = P_posnr.
"selection parameter

INCLUDE ZMODULAR_BRF_CODE.

IF <la_any> is ASSIGNED.
   lw_output-i_fkber = <la_any>.
ENDIF.

write:/ lw_output-i_fkber.

As per my manager's whims, I can only change the code outside the INCLUDE. So the include program must not be touched as its a system generated BRF+ code template.

Regards

pokrakam
Active Contributor

<la_any> is a deep structure. You can't assign a deep structure to a char field. This has nothing to do with field symbols, this is standard ABAP, if you want the value of I_FKBER component then assign <la_any>-i_fkber.

0 Kudos

Can u plz let me know the code ?

pokrakam
Active Contributor

I just did.

pokrakam
Active Contributor

Agree the later one should be deleted, but then again people would answer the first one they read, from the top. Hence I said it makes for a good lesson (although in this instance the OP still got his answer 🙂

matt
Active Contributor
0 Kudos

Please use the "code" button when entering code. And as a tip, when pasting code from the editor, use right-click "Paste as plain text".

Also remove any unnecessary code, such as commented out lines.

I've made these changes for you this time. See how much better it looks? Easier to read? More likely to get answers...?

You still haven't shown how <la_any> is defined. (Which is a bad name for a field-symbol - in fact your variable naming is poor, since you're declaring variables with l prefix that are not local).