Skip to Content
Nov 11, 2015 at 12:46 PM

ABAP Program for Fiscal and Accounting


Hello All,

I need a little help with a ABAP Routine.

In my point of view it is simple, but as my ABAP knowledge is a few poor, I need some help with the code.

I have a field called Document Reference (DOC_REF) and this field receives through a transformation rule values from two other fields: NUMNF (with 9 characters) and SERIE (with 4 characters).

In this moment I need to apply a routine that will concatenate these two values in only one converting to an specific format. Example:

NUMNF = 000001234

SERIE = 0001

Output result DOC_REF = 1234-1

This routine must concatenate the two values, putting a "-" between them. All the zeros to the left of the both values must be removed.

There is an important point concerning the field SERIE, because it must to consider all the values, not only the last one. Examples:

NUMNF = 000001234

SERIE = 0021

DOC_REF = 1234-21

NUMNF = 000051234

SERIE = 0521

DOC_REF = 51234-521

NUMNF = 000871234

SERIE = 9521

DOC_REF = 871234-9521

Could you please help me with this ABAP code?

Thank you.