Sunday, December 28, 2014

Mass deletion of sales orders

Go to TCode MASS, input Object Type BUS2032 and execute.
There select Sales Order Item Data  and click on Fields.
Again select Field Name MASSVBAP-ABGRU  and execute.  Key in those sale orders and execute.
Maintain some reason for rejection and execute, so that the status of the sale orders would be changed to completed.

Saturday, November 22, 2014

Removing specified characters from string

* Remove all occurrences of single and double quotes
  REPLACE ALL OCCURRENCES OF SUBSTRING '''' IN lv_all_params WITH ''.
  REPLACE ALL OCCURRENCES OF SUBSTRING '"' IN lv_all_params WITH ''.

Replace/Remove Specified Characters From String

DATA legal_chars TYPE string
      VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.,-*_!?'.
DATA lv_char_value(255)" give max length

lv_char_value gv_string.
CHECK NOT lv_char_value CO legal_chars ).

lv_length strlengv_string ).

DO lv_length TIMES.
  lv_i sy-index 1.
  IF NOT lv_char_value+lv_i(1CO legal_chars.
    "We get the illegal char , do what you want
    lv_char_value+lv_i(1' '.
  ENDIF.
ENDDO.

CLEAR gv_string.
gv_string lv_char_value.

Wednesday, July 23, 2014

How to get Cancel invoice from VBRK table.

TO get the cancelled invoice the query will be like below:

if FKSTO EQ 'X'
and VBTYP EQ 'N' OR FKART EQ 'S1'.


AND SFAKN is for getting cancelled invoice number.

Sunday, June 29, 2014

Example Code For Selection Screen Output

REPORT ZSELECTION_SCREEN.

selection-screen :begin of block test with frame title text-001
parameters:radiobutton group one user-command test
                 b radiobutton group one
selection-screen:end of block test
selection-screen:begin of block test2 with frame title text-002
parameters:input1(10TYPE MODIF ID TL
                 input2(10TYPE MODIF ID TT
selection-screen:end of block test2
   
AT SELECTION-SCREEN OUTPUT
  IF 'X'
      LOOP AT SCREEN
          CHECK SCREEN-GROUP1 'TT'
          SCREEN-INPUT '0'
          MODIFY SCREEN
      ENDLOOP
  ENDIF.

  IF 'X'
      LOOP AT SCREEN
         CHECK SCREEN-GROUP1 'TL'
         SCREEN-INPUT '0'
         MODIFY SCREEN
      ENDLOOP
  ENDIF.

Thursday, April 24, 2014

HOW TO BLOCK MATERIAL MASTER

Material master locked is when one user will try to use material code which is currently used by another user so he will get the message that material is locked by user.
Blocked means we can't do any further processing action at the block level and using program run we can able to delete the material, using MARA, MARC MARD tables can find the different level of Blocking and Flag for deletions.(Tcode MM06)
Using T.code SE11--> MARA -->LVORM(X)

Monday, March 3, 2014

How to create cockpit


REPORT ZCOCKPIT no standard page heading.
tables : sscrfields.

selection-screen : begin of block block1 with frame title text-001.

selection-screen skip 1.
selection-screen begin of line.
selection-screen : position 10, pushbutton (30) p_but1 user-command but1,
                   pushbutton (30) p_but2 user-command but2,
                   pushbutton (30) p_but3 user-command but3.

selection-screen end of line.

selection-screen begin of line.
selection-screen : position 10, pushbutton (30) p_but4 user-command but4,
                   pushbutton (30) p_but5 user-command but5,
                   pushbutton (30) p_but6 user-command but6.
selection-screen end of line.

selection-screen : end of block block1.


initialization.

  p_but1  = 'CREATE SALES ORDER'.
  p_but2  = 'CREATE OBD ORDER'.
  p_but3  = 'CREATE GR'.
  p_but4  = 'CREATE PGI ORDER'.
  p_but5  = 'CREATE SHIPMENT ORDER'.
  p_but6  = 'MISC'.

at selection-screen.
  case sscrfields-ucomm.
    when 'BUT1'.
      leave to transaction 'VA01'.
    when 'BUT2'.
      leave to transaction 'VL01N'.
    when 'BUT3'.
      leave to transaction 'MIGO'.
    when 'BUT4'.
      leave to transaction 'VL02N'.
    when 'BUT5'.
      leave to transaction 'VT01N'.
    when 'BUT6'.
      leave to transaction 'VT02N'.
  endcase.



Output:



Drop Down lists in the selection parameters

PROGRAM ztest.   TYPE-POOLS : vrm.   DATA : name TYPE vrm_id,        list TYPE vrm_values,        value LIKE LINE OF list. ...