Skip to Content
0
Jan 23 at 02:51 PM

Extracting OCMT & CHGS subfields from a Note to Payee field in SAP ABAP

86 Views Last edit Jan 23 at 02:53 PM 2 rev

Hello Everyone,

My requirement is to extract the OCMT and CHGS subfields from a Note to Payee field. I need help with just the text parsing for various scenarios.

Example:
Input- '1811291129CR55589,95NTRF3825-0061490955//97271/009/OCMT/EUR55600,//CHGS/EUR10,05/'
Output should be-
lv_ocmt =EUR55600
lv_chgs =EUR10,05
I can refine it further. I just need help with the text parsing part.

Scenario: 1-The above input can have multiple CHGS.
2- position of OCMT and CHGS can be reverse or arbitrary.
so in both the scenarios, our output shouldn't be affected.
E.g.

'1811291129CR55589,95NTRF3820061490955//97271/009/OCMT/EUR55600,//CHGS/EUR10,05//CHGS/EUR10,05/'

Can you please help me this.
Thanks in advance. :)