TECH SYNTAX

Tuesday, July 29, 2014

Sample code: How To read Header or Item Partner Address using function modules.

WEB UI programmers find it very easy to read a partner address, be it at document header level or for a specific item using BOL programming. But when it comes to read it using the CRM function modules, it gets confusing. The below sample code explains how to read the header or item partner address using CRM function modules, when you are advised not to use the BOL programming e.g. inside a BAdi implementation.


DATA:
      lt_guid                TYPE   crmt_object_guid_tab,
      lt_orderadm_h     TYPE   crmt_orderadm_h_wrkt,
      lt_req_obj            TYPE   crmt_object_name_tab,
      lt_orderadm_i      TYPE   crmt_orderadm_i_wrkt,
      lt_partners           TYPE   crmt_partner_external_wrkt,
      lt_adrc                TYPE   bbpt_adrc.

DATA:
      ls_object_guid    TYPE   crmt_object_guid,
      ls_req_obj          TYPE   crmt_object_name.

FIELD-SYMBOLS:          TYPE crmt_partner_external_wrk,
                                 TYPE crmt_orderadm_h_wrk,
                                  TYPE crmt_orderadm_i_wrk,
                                            TYPE adrc.

************************************* Call the order_read *********************************************

ls_req_obj = 'ORDERADM_H'.
INSERT ls_req_obj INTO TABLE lt_req_obj.
ls_req_obj = 'ORDERADM_I'.
INSERT ls_req_obj INTO TABLE lt_req_obj.
ls_req_obj = 'PARTNER'.
INSERT ls_req_obj INTO TABLE lt_req_obj.

ls_object_guid     = iv_guid.   " Fill the guid to be inserted
INSERT ls_object_guid INTO TABLE lt_guid.
CALL FUNCTION 'CRM_ORDER_READ'
   EXPORTING
     it_header_guid       = lt_guid
     it_requested_objects = lt_req_obj
   IMPORTING
     et_orderadm_h        = lt_orderadm_h
     et_orderadm_i        = lt_orderadm_i
     et_partner           = lt_partners
   EXCEPTIONS
     document_not_found   = 1
     error_occurred       = 2
     document_locked      = 3
     no_change_authority  = 4
     no_display_authority = 5
     no_change_allowed    = 6
     OTHERS               = 7.

********************************************* Read the header details *******************************************
READ TABLE lt_orderadm_h ASSIGNING  INDEX 1.
IF sy-subrc = 0.
   READ TABLE lt_partners ASSIGNING 
        WITH KEY ref_guid    = -guid
                 partner_fct = '00000132'.               " the partner function to find its address details.
   IF sy-subrc = 0.
     CALL FUNCTION 'ADDR_SELECT_ADRC_SINGLE'
       EXPORTING
         addrnumber        = -addr_nr
       TABLES
         et_adrc           = lt_adrc
       EXCEPTIONS
         address_not_exist = 1
         parameter_error   = 2
         internal_error    = 3
         OTHERS            = 4.
     IF NOT lt_adrc IS INITIAL.
       READ TABLE lt_adrc ASSIGNING  INDEX 1.   " Now here you found the address details
       IF sy-subrc = 0.
         ev_province_head = -region.            " Get the region.
       ENDIF.
     ENDIF.
   ENDIF.
ENDIF.

************************************** Read the line item for a specific iteam ************************************

READ TABLE lt_orderadm_i ASSIGNING  WITH KEY itm_type = 'ZCOL'.

IF sy-subrc = 0.
   READ TABLE lt_partners ASSIGNING 
        WITH KEY ref_guid    = -guid
                partner_fct = '00000132'.                " the partner function to find its address details.

   IF sy-subrc = 0.
     CALL FUNCTION 'ADDR_SELECT_ADRC_SINGLE'
       EXPORTING
         addrnumber        = -addr_nr
       TABLES
         et_adrc           = lt_adrc
       EXCEPTIONS
         address_not_exist = 1
         parameter_error   = 2
         internal_error    = 3
         OTHERS            = 4.
     IF NOT lt_adrc IS INITIAL.
       READ TABLE lt_adrc ASSIGNING  INDEX 1.   " Now here you found the address details
       IF sy-subrc = 0.
             ev_province_item = -region.        " Get the region.
       ENDIF.
     ENDIF.
   ENDIF.
ENDIF.

Tuesday, April 28, 2009

CHAT WITH COMMAND PROMOPT

If you want a private chat with a friend or client on you Network, you don't need to download any fancy program!
All you need is your friends IP address and Command Prompt.
Firstly, open Notepad and enter:

@echo off
:A
Cls
echo MESSENGER
set /p n=User:
set /p m=Message:
net send %n% %m%
Pause
Goto A

Now save this as "Messenger.bat". Open the .bat file and in Command Prompt you should see:

MESSENGER
User:

After "User" type the IP address of the computer you want to contact.
After this, you should see this:
Message:
Now type in the message you wish to send.
Before you press "Enter" it should look like this:

MESSENGER
User: 56.108.104.107
Message: Hi

Now all you need to do is press "Enter", and start chatting!

Make your xp talk ....

Open a text file in notepad and write:

Dim msg, sapi
msg=InputBox("Enter your text","Talk it")
Set sapi=CreateObject("sapi.spvoice")
sapi.Speak msg

Save the file with a (*.vbs) extension, it will create a VBScript File.

It will prompt you for a text while opening the file, input the text and press ok it will speak whtaever u type in..........................enjoyyyyyyyyyyyy

XP Game secrets.......

FreeCell

Secret 1. - Instant Win
Instructions - Hold down Ctrl + Shift + F10 during game play. Then you will be asked if you want to Abort, Retry or Ignore. Choose Abort, then move any card to instantly win.

Secret 2. - Hidden Game Modes
Instructions - In the "Game" menu choose "Select Game". Enter -1 or -2 to activate the hidden game modes.


Hearts

Secret - Show All Cards
Instructions - Edit this registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Hearts and create a new String value named ZB with a Data value of 42. Start Hearts and Press Ctrl + Alt + Shift + F12 to show all the cards.


Minesweeper

Secret - Reveal Mines
Instructions - Minimize or close all running applications. Launch Minesweeper, then type xyzzy. Next hold down either shift key for one second. Now when you move the mouse cursor over a Minesweeper square you will see a tiny white pixel in the top left corner of your desktop screen. This pixel will change to black when your mouse moves over a mine. You may need to change you desktop background to a solid color other then white or black to see the pixel.

Secret - Stop Timer
Instructions - Launch Minesweeper and start a game so the timer starts counting, then press the Windows Key + D to show the desktop. Now when you select minesweeper from the taskbar you can continue playing with the timer stopped.


Pinball

Secret - Extra Balls
Instructions - Type 1max at the start of a new ball to get extra balls.

Secret - Gravity Well
Instructions - Type gmax at the start of a new game to activate the Gravity Well.

Secret - Instant Promotion
Instructions - Type rmax at the start of a new game to go up in ranks.


Enjoyyyyyyy gaming but do leave ur comments...

Hidden XP programms !!!

Most OF Us Would Know This ................ But dis is A Collection......
Do Comment If U Like IT

Programs :

1. Private Character Editor :
Used for editing fonts,etc.
** start>>Run
** Now, type eudcedit

2. Dr. Watson :
This an inbuilt windows repairing software !
** start>>Run
** Now, type drwtsn32

3. Media Player 5.1 :
Even if you upgrade your Media Player, you can still access your old player in case the new one fails !!!
** start>>Run
** Now, type mplay32

4. iExpress :
Used to create SetupsYou can create your own installers !
** start>>Run
** Now, type iexpress
Your Ad Here