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

string space trimming problem

Former Member
0 Likes
532

Hi all,

I have a little problem:

I have this data:

TYPES: BEGIN OF sales_budget_t,
  matnr       TYPE matnr,
  descr       TYPE maktx,
  stpo_menge  TYPE kmpmg_bi,
  ekpo_menge  TYPE kmpmg_bi,
  menge       TYPE kmpmg_bi,
  verpr       TYPE p DECIMALS 2,
  ebeln       TYPE ekpo-ebeln,
  ebelp       TYPE ekpo-ebelp,
  netpr       TYPE p DECIMALS 2,
  teo_value   TYPE p DECIMALS 2,
  oda_value   TYPE p DECIMALS 2,
  delta       TYPE p DECIMALS 2,
  delta_100   TYPE p DECIMALS 2,
  lifnr       TYPE ekko-lifnr,
  m_lifnr(1)  TYPE c,
  descr_lifnr TYPE lfa1-name1,
END OF sales_budget_t.

on my screen, this data are represented by string (I need it for managing some aspects)

* screen element
DATA str_mat TYPE string.
DATA str_descr TYPE string.
DATA str_verpr TYPE string..
DATA str_quantity TYPE kmpmg_bi.
DATA str_ebelnp TYPE string.
DATA str_netpr TYPE string.
DATA str_teo_value TYPE string.
DATA str_oda_value TYPE string.
DATA str_delta TYPE string.
DATA str_delta_100 TYPE string.
DATA str_ekpo_menge TYPE string.
DATA str_lifnr TYPE string.
DATA str_descr_lifnr TYPE string.
DATA str_sales_order TYPE string.
DATA str_customer TYPE string.
DATA str_odp TYPE string.

and are part of a teble control .. while looping through PBO loop I assign value from internal table data to screen element.

the problem is that data in table have some spaces before values, and it seems that puttin "right align" on screen painter doesn't work and I cannot understand why.

can anybody help me please?

gabriele

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
500

Hi,

Just Before assigning the sting value to internal table use the following.

CONDENSE: STR1, STR2, STR3.

Hope will solve out your problem,

Please Reply if any Issue and explain it bit more,

Best Regards,

Faisal

3 REPLIES 3
Read only

faisalatsap
Active Contributor
0 Likes
501

Hi,

Just Before assigning the sting value to internal table use the following.

CONDENSE: STR1, STR2, STR3.

Hope will solve out your problem,

Please Reply if any Issue and explain it bit more,

Best Regards,

Faisal

Read only

0 Likes
500

before passing to your work area of type p or other types

use:

CONDENSE:
str_mat no space,
str_descr no space,
str_verpr no space,
str_quantity no space,
str_ebelnp no space,
str_netpr no space,
str_teo_value no space,
str_oda_value no space,
str_delta no space,
str_delta_100 no space, 
str_ekpo_menge no space,
str_lifnr no space,
str_descr_lifnr no space,
str_sales_order no space,
str_customer no space,
str_odp no space.

and then pass.

Read only

Former Member
0 Likes
500

Hi,

use condense ...

Thanks

Ashu Singh