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

Replace '-' with '.'

Former Member
0 Likes
1,051

Hi Gurus,

I need ABAP Programme which will replace '-' with '.' for profit center where company code equal to { PTUS, HQUS, CTCA} . I dont want to replace other profit centers.

I need to update in Extract Structure. Details

Structure Name : BWEC_MD_PROFIT_CTR.

Table Name : CEPC_BUKRS.

In the structure I have profit center and I need to look up CEPC_BUKRS table to check company code condition.

Please some one provide me the code.

Thanks

Ganesh Reddy.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,016

if CEPC_BUKRS-bukrs <> 'companycodeA' or 'companycodeB' etc .

replace '-' with '.'

endif.

Will this not suffuice or may be I havent understood your issue correctly.

Cheers Vick

9 REPLIES 9
Read only

Former Member
0 Likes
1,017

if CEPC_BUKRS-bukrs <> 'companycodeA' or 'companycodeB' etc .

replace '-' with '.'

endif.

Will this not suffuice or may be I havent understood your issue correctly.

Cheers Vick

Read only

0 Likes
1,016

Hi Vick,

Yes you are give me proper code. I am not a techical, please if you could just give me how to bring values into internal table, filter, replace and modify to structure.

If you help me that will be great.

Sidharth, thanks for quick reply. Just give me with company code condition. There is no company code in BWEC_MD_PROFIT_CTR. Company code exist in CEPC_BUKRS table.

Thanks

Ganesh Reddy.

Edited by: Ganesh Reddy on Feb 27, 2009 6:14 PM

Edited by: Ganesh Reddy on Feb 27, 2009 6:16 PM

Read only

0 Likes
1,016

Hi,

data : wa type CEPC_BUKRS,
         itab type table of CEPC_BUKRS.

loop at itab into wa.
  case wa-bukrs.
    when 'PTUS' or 'HQUS' or 'CTCA'.
         replace all occurences of '-' in wa with '.'.
         modify itab from wa index sy-tabix.
  endcase.
endloop.

Regards,

Siddarth

Read only

0 Likes
1,016

I guess Sid has provided u with the solution ...

Plzz dont make any changes to a production program if you do not have programming background.

Cheers

Vick

Edited by: vick vennav on Feb 27, 2009 6:23 PM

Read only

0 Likes
1,016

Thanks Sidharth/Vick,

I am testing this in R/3 Development. Any way this is for extract structure changes which is related to BW. As for my knowledge I dont think it impacts to any data base tables.

Sidharth, before I close this forum I want to modify to extract structure (BWEC_MD_PROFIT_CTR) but not to the table (CEPC_BUKRS). Please could you tell me do I need to change any thing in your code.

Thanks

Ganesh Reddy.

Read only

0 Likes
1,016

Hi,

Please check if this works

you need to equate wa to extract and then use the statement

modify extract index sy-tabix.

Regards,

Siddarth

Read only

0 Likes
1,016

Thanks Sidharth/Vic.

Read only

Former Member
0 Likes
1,016

We don't work for free, we don't do your job. If you have a specific query, feel free to ask, as we all learn from it, but don't ask for full pieces of code.

Read only

Former Member
0 Likes
1,016

Hi,

loop at CEPC_BUKRS into BWEC_MD_PROFIT_CTR.
  replace '-' in BWEC_MD_PROFIT_CTR-PTUS with '.'.
  replace '-' in BWEC_MD_PROFIT_CTR-HQUS with '.'.
  replace '-' in BWEC_MD_PROFIT_CTR-CTCA with '.'.
endloop.

Regards,

Siddarth