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: 

How to assign a space like ' ' to a field symbol

Former Member
0 Kudos

Hi experts,

I want to assign a space to a field symbol, so just to make the field not to be null. I coded as below, but I keep getting dump. Am I missing anyting or assign a space to field symbol is not possible.

   FIELD-SYMBOLS: <fs1>.

  <fs1> = ' '.
  UNASSIGN <fs1>.

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI

The field-symbol is a pointer, so you need to assign a variable to it, if this variable is blank, the field-symbol will be blank too

Max

11 REPLIES 11

Former Member
0 Kudos

Can you create a constant field and assign that?

Neal

0 Kudos

I  tried this and didn't work

Former Member
0 Kudos

HI

The field-symbol is a pointer, so you need to assign a variable to it, if this variable is blank, the field-symbol will be blank too

Max

0 Kudos

Yeah I tried this as well and it didn't work

0 Kudos

Hi

DATA L_SPACE(1) TYPE C.

FIELD-SYMBOLS: <FS1> TYPE ANY.

ASSIGN L_SPACE TO <FS1>.

It works.

Max

Former Member
0 Kudos

Hi Blue,

You want to assign.

ASSIGN space to <fs1>.


Thanks,

Kiran

0 Kudos

Hi Kiran,

Thank you and it works without giving me dump. But the ultimate problem I want to fix still there, see the screen shot below, there is a very narrow empty column between first and second column, I don't want it, but I am not sure how to get rid of it, seems ASSIGN space to <fs1> doesn't help.

0 Kudos

Hi Blue,

How you are getting this output, is it in ALV grid. can you paste the relevant code.

0 Kudos

What mechanism are you using to display output.

Nabheet

0 Kudos

Hi Kiran,

This is a dynamic ALV, the displays columns depends on the user input.

I think the problem happens if there is no data value or null data value in the cells of second column, then that little narrow columns appears. I tested, it all the cells under second column have data, then the little narrow column won't display.

Here is part of the code:

      READ TABLE t_alldata WITH KEY quotdate = wa_alldata-quotdate
                                        quotname = gw_dyn_fcat-fieldname INTO wa_alldata1.
          IF sy-subrc = 0." and NOT wa_alldata1-pricequot is INITIAL.
           
            ASSIGN COMPONENT gw_dyn_fcat-fieldname OF STRUCTURE <gfs_line> TO <fs1>.
           
            if NOT wa_alldata1-pricequot is INITIAL.             
              PERFORM FORMAT_DECIMAL USING wa_alldata1-pricequot CHANGING prc.
              <fs1> = prc.
             
            else.
              ASSIGN space to <fs1>.
            endif.
           
            UNASSIGN <fs1>.
            flgref = 0.
          ENDIF.
          CLEAR : wa_alldata1.

0 Kudos

this is a Dynamic ALV