Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem in logic of the Function Module

Hi,

I am working on FM in which i have to pass the value as string and it gives value that if there is a space in the string it will pick the rest of the string in the next value starting from the spcae. here's d code:-


IF TEXT1+20(1) EQ ' '.
          text2 = text1.
          text1 = text1+21(19).
          text3 = text1.

        ELSEIF TEXT1+19(1) EQ ' '.
          text2 = text1.
          text1 = text1+22(18).
          text3 = text1.
        elseif TEXT1+18(1) EQ ' '.
          text2 = text1.
          text1 = text1+23(17).
          text3 = text1.
        elseif TEXT1+17(1) EQ ' '.
          text2 = text1.
          text1 = text1+24(16).
          text3 = text1.
        elseif TEXT1+16(1) EQ ' '.
          text2 = text1.
          text1 = text1+25(15).
          text3 = text1.
        elseif TEXT1+15(1) EQ ' '.
          text2 = text1.
          text1 = text1+26(14).
          text3 = text1.
        elseif TEXT1+14(1) EQ ' '.
          text2 = text1.
          text1 = text1+27(13).
          text3 = text1.
ENDIF.

here text1,text2 and text3 are TYPE QAMR--PRUEFBEMKT with length of 40 characters.

plzz provide me guidlines if there is any thing needed to rectified.

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question