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: 

Delete 3 letter from one Input

Former Member
0 Kudos

Hi all,

Here i have one coding for my report which is shown below.



 IF s_fkart = 'ZF2T'.
      inv_txt   = 'T'.
      Inv_name  = 'TAX INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart   = 'ZF2R'.
      inv_txt   = 'R'.
      inv_name  = 'RETAIL INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart   = 'ZF2C'.
      inv_txt   = 'C'.
      inv_name  = 'RETAIL INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart   = 'ZSTI'.
      inv_txt   = 'ST'.
      inv_name  = 'PROFORMA INVOICE'.
*      itab1-INVOICE   = 'STOCK TRANSFER'.
    ENDIF.


    APPEND ITAB1.


here s_fkart is input filed at a run time.

In this code this all condition never true.

when i debug this report this time i show in variable s_fkart has IEQZF2T but i need only ZF2T .

and i define this like vbrk fkart .

so can u help me out how can i delete this first three latter from this variable ...

1 ACCEPTED SOLUTION

former_member223537
Active Contributor
0 Kudos

Hi,

IF s_fkart-low = 'ZF2T or         " Add LOW
     s_fkart-high = 'ZF2T'.             " Add HIGH
      inv_txt   = 'T'.
      Inv_name  = 'TAX INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart-low   = 'ZF2R' or
                 s_fkart-high   = 'ZF2R'..
      inv_txt   = 'R'.
      inv_name  = 'RETAIL INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart-low   = 'ZF2C' or
                 s_fkart-high   = 'ZF2C'.
      inv_txt   = 'C'.
      inv_name  = 'RETAIL INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart-low   = 'ZSTI' or
                 s_fkart-high   = 'ZSTI'.
      inv_txt   = 'ST'.
      inv_name  = 'PROFORMA INVOICE'.
*      itab1-INVOICE   = 'STOCK TRANSFER'.
    ENDIF.

Thanks,

Best regards,

Prashant

5 REPLIES 5

Sandeep_Kumar
Advisor
Advisor
0 Kudos

No need to do anything , just compare s_fkart-low.

former_member223537
Active Contributor
0 Kudos

Hi,

IF s_fkart-low = 'ZF2T or         " Add LOW
     s_fkart-high = 'ZF2T'.             " Add HIGH
      inv_txt   = 'T'.
      Inv_name  = 'TAX INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart-low   = 'ZF2R' or
                 s_fkart-high   = 'ZF2R'..
      inv_txt   = 'R'.
      inv_name  = 'RETAIL INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart-low   = 'ZF2C' or
                 s_fkart-high   = 'ZF2C'.
      inv_txt   = 'C'.
      inv_name  = 'RETAIL INVOICE'.
*      itab1-INVOICE   = 'DEBIT INVOICE'.
    ELSEIF  s_fkart-low   = 'ZSTI' or
                 s_fkart-high   = 'ZSTI'.
      inv_txt   = 'ST'.
      inv_name  = 'PROFORMA INVOICE'.
*      itab1-INVOICE   = 'STOCK TRANSFER'.
    ENDIF.

Thanks,

Best regards,

Prashant

0 Kudos

Hi ,

Thanks dear,

I solve my Query from your suggestion.

Thanks a lot friend .

Regards,

Keyur chauhan

former_member320332
Contributor
0 Kudos

Hi Keyur,

You are getting s_fkart value as IEQZF2T because whwnever you declare select-option it creates selection table internally and

the row type of a selection table is a structure that consists of four components: SIGN, OPTION, LOW, and HIGH

So here SIGN is I and OPTION is EQ and LOW, and HIGH contains the value so you have to use only this. For your understanding read the documentation on Selection table it will be more clear to you.

Regards,

Pawan

Former Member
0 Kudos

Hi,

You can try like this.

constants : c_zf2t TYPE vbrk-fkart.

IF c_zf2t IN s_fkart.

inv_txt = 'T'.

ELSE.

ENDIF.

Hope it helps.

Sujay