Application Development 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: 

split-ted OBJNR-COEP in the selection screen.....?

Former Member
0 Kudos

Hi Experts,

I want the solution for how to put the split-ted OBJNR-COEP ( Object Number ....ex : ORSAL03O10001A ) .... so i want to give only 10001A in the selection screen input ( From & To )  . So please suggest me .

SELECT-OPTIONS : S_OBJNR  FOR COEP-OBJNR ." OBLIGATORY.


SELECT  KOKRS

           BLDAT

           BELNR

           BUDAT

           REFBN

           BLTXT

           VRGNG

     FROM COBK INTO CORRESPONDING FIELDS OF TABLE IT_COBK

           WHERE KOKRS EQ 'C000'

             AND BUDAT IN S_BUDAT.

   IF IT_COBK[] IS NOT INITIAL.

     SORT  IT_COBK BY KOKRS BELNR.

    

     SELECT  KOKRS

             BUKRS

             KSTAR

             BELNR

             OBJNR

             PAROB

             SGTXT

             GKONT

             GKOAR

             WTGBTR

             VRGNG

             TWAER

             BEKNZ

             FROM COEP INTO CORRESPONDING FIELDS OF TABLE IT_COEP

             FOR ALL ENTRIES IN IT_COBK

             WHERE KOKRS EQ IT_COBK-KOKRS

               AND BELNR EQ IT_COBK-BELNR

               AND OBJNR IN S_OBJNR

               AND KSTAR IN S_KSTAR

               AND BUKRS EQ P_BUKRS.

   ENDIF.



please check the above code for reference.

Regards,

Suresh

3 REPLIES 3

0 Kudos


try obj_split = obj+8(6)

where obj is the object number.

Best regards,

Saurabh

0 Kudos

Dear Saurabh,

How can i put in selection screen . Plz elaborate.....?

Regards,

Suresh

0 Kudos

Or if you want your users to enter only 10001A and concatenate the rest of objnr later programatically you can use this code and use obj2 in select queries-

data obj type char6.

data obj_full type COEP-OBJNR.

SELECT-OPTIONS : obj1 for obj.

ranges : obj2 for obj_full.

LOOP AT obj1.

  MOVE-CORRESPONDING obj1 to obj2.

  IF obj2-low is not initial.

    concatenate 'ORSAL03O' obj2-low into obj2-low.

  ENDIF.

  IF obj2-high is not initial.

    concatenate 'ORSAL03O' obj2-high into obj2-high.

  ENDIF.

  append obj2.

ENDLOOP.

Best of luck,

Saurabh