Friday 16 September 2016

What would be the o/p of the program V1.0 ?

Hello Friends,

What would be the output of the below two program.
zpar_at_end_of_1.
zpar_at_end_of_2.


REPORT zpar_at_end_of_1.
TYPESBEGIN OF ty_tab,
         id    TYPE char5,
         name  TYPE char50,
         email TYPE char40,
       END OF ty_tab.

DATAlt_tab TYPE STANDARD TABLE OF ty_tab INITIAL SIZE 0,
      ls_tab TYPE ty_tab.

ls_tab-id '00001'.
ls_tab-name 'PARTHA SARATHI GOSWAMI'.
ls_tab-email 'DUMMY_1_email@gmail.com'.
APPEND ls_tab TO lt_tab.

ls_tab-id '00001'.
ls_tab-name 'PARTHA SARATHI GOSWAMI'.
ls_tab-email 'DUMMY_2_email@gmail.com'.
APPEND ls_tab TO lt_tab.

LOOP AT lt_tab INTO ls_tab.
  AT END OF id.
    WRITE:/ ls_tab-name.
  ENDAT.
ENDLOOP.


REPORT ZPAR_AT_END_OF_2.

TYPESBEGIN OF ty_tab,
         id    TYPE char5,
         name  TYPE char50,
         email TYPE char40,
       END OF ty_tab.

DATAlt_tab TYPE STANDARD TABLE OF ty_tab INITIAL SIZE 0,
      ls_tab TYPE ty_tab.

FIELD-SYMBOLS<lfs_tab> TYPE ty_tab.

ls_tab-id '00001'.
ls_tab-name 'PARTHA SARATHI GOSWAMI'.
ls_tab-email 'DUMMY_1_email@gmail.com'.
APPEND ls_tab TO lt_tab.

ls_tab-id '00001'.
ls_tab-name 'PARTHA SARATHI GOSWAMI'.
ls_tab-email 'DUMMY_2_email@gmail.com'.
APPEND ls_tab TO lt_tab.

LOOP AT lt_tab ASSIGNING <lfs_tab>.
  AT END OF id.
    WRITE:/ <lfs_tab>-name.
  ENDAT.
ENDLOOP.
     

Tuesday 29 March 2016

EDI

Electronic Data Interchange (EDI) is an electronic communication method that provides standards for exchanging data via any electronic means. By adhering to the same standard, two different companies or organizations, even in two different countries, can electronically exchange documents (such as purchase orders, invoices, shipping notices, and many others).

It is important to differentiate between the EDI documents and the methods for transmitting them.
Some of the well-known protocols (transmitting medium) are as below:
HTTP/HTTPS, SMTP, SOAP, FTP, EDIINT (AS1/2/3/4) etc.

Some of the well-known formats (EDI documents) are as below:
X12, SAP-XML, EDIFACT etc.
X12 is used in the USA but most of the rest of the world uses the EDIFACT transaction sets.

Many view EDI from the technical perspective that EDI is a data format; it would be more accurate to take the business view that EDI is a system for exchanging business documents with external entities, and integrating the data from those documents into the company's internal systems.

SAP supports EDI through IDoc(s). That means SAP created different IDoc(s) for different EDI.
Msg Type
Basic Type
Description
EDIFACT
X12
ORDERS
ORDERS05
Vendor PO
ORDERS
850, 875
ORDRSP
ORDERS05
PO Response
ORDRSP
855, 865
ORDCHG
ORDERS05
PO Change Request
ORDCHG
860, 876
SHPADV
SHPMNT05
Advanced Ship Notification
SHPMNT
856
WHSCON
DELVRY03
Stock confirmation
RECADV
856, 867, 945
WHSCON
DELVRY03
Stock confirmation & PGI
RECADV
856, 867, 945
SHPCON
DELVRY03
Ship confirmation
RECADV
856, 867, 945
INVOIC
INVOIC02
Customer Invoice
INVOIC
810, 880
PAYEXT
PEXR2002
Extended payment order
PAYEXT
820
PAYEXT
PEXR2002
Multiple payment order
PAYMUL
820
PAYEXT
PEXR2002
Payment order
PAYORD
820
STATUS
SYSTAT01
Acknowledgement
CONTRL
997
STATUS
SYSTAT01
Functional acknowledgement
FUNACK
997




Without EDI (Email, Fax) Vs. With EDI

http://cdn2.hubspot.net/hub/126065/file-47415370-jpg/images/consumer_goods_graphic_2.jpg?t=1457659461668&width=323&height=310


Here I tried to depict a clear view how important EDI is acting in any kind of ERP business.
In the below points you will be able to co-relate the MM and SD module.
When PO created in SAP through ME21N, the order goes in ORDERS IDoc format and subsequently hit EDI850 and transferred to supplier system as sales order.

Vendor response back with EDI855 at the time the EDI850 reached into vendor system. The response will post in our organization’s SAP system as IDoc ORDRSP (PO acknowledgement).

Any change in PO (ME22N) will send to vendor at real time. For this SAP generated IDoc ORDCHG and that subsequently transform into EDI860 and changes reflect in vendor system.

Vendor response back with EDI865 at the time the EDI860 reached into vendor system. The response will post in our organization’s SAP system as IDoc ORDRSP (PO acknowledgement).

Vendor creates outbound delivery (VL03N)and then it goes as EDI856 that will post in our org. as ASN/inbound delivery (VL33N).

Vendor sends the billing document that mapped to EDI810 and subsequently post in our SAP system as IDoc INVOIC (MIR4).
Vendor payment will send as IDoc PAYTXT and that pass through the EDI820 to vendor.

EDI997 is very important. It carries the functional acknowledgement for each IDoc. It post into SAP as IDoc STATUS.

When each project goes live, we generally use the same inbound response IDoc – STATUS (basic type SYSTAT01) to monitor our outbound IDoc data goes into vendor system successfully or not.

Sunday 14 February 2016

Let us ABAP 7.40

C:\Users\Partha\Desktop\HANA\image002.jpg

Today, obviously your company/client running their SAP on latest version ABAP 7.40 (although super latest is 7.50)
Please check it before proceeding further.

You have checked it by now and found its ABAP 7.40
Great!! Now you can dig into the rest of the post. 

You can simply copy paste the code below and enjoy the “NEW WAY” of coding! 

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
* On the fly Data declaration for VARIABLE.
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*

*---------------------------------------------------------------------------------------------------------------
****************************************OLD WAY****************************************
*DATA: v_var1 type string.
*
*v_var1 = 'Hello ABAP 7.40'.
*
*WRITE:/ v_var1.
*---------------------------------------------------------------------------------------------------------------

*---------------------------------------------------------------------------------------------------------------
*****************************************NEW WAY*********************************
DATA(v_var1) = 'Hello ABAP 7.40'.

WRITE:/ v_var1.
*---------------------------------------------------------------------------------------------------------------




*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* On the fly Data declaration for WORK AREA / FIELD-SYMBOL
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TYPESBEGIN OF ty_ekko,
                  ebeln  TYPE ebeln,
                  bukrs  TYPE bukrs,
                  bsart   TYPE esart,
                  aedat  TYPE erdat,
                  ernam TYPE ernam,
               END OF ty_ekko.

DATAlt_ekko TYPE STANDARD TABLE OF ty_ekko.

SELECT ebeln
                 bukrs
                 bsart
                 aedat
                 ernam
       from ekko
       into TABLE lt_ekko
       where ernam sy-uname.


*---------------------------------------------------------------------------------------------------------------
****************************************OLD WAY***********************************
*DATA: ls_ekko TYPE ekko.
*FIELD-SYMBOLS: <lfs_ekko>.
*DATA: lv_count TYPE i.

*  LOOP AT lt_ekko INTO ls_ekko.
*     WRITE:/ ls_ekko-ebeln,
*             ls_ekko-aedat.
*  ENDLOOP.

*  LOOP AT lt_ekko ASSIGNING <lfs_ekko>.
*     WRITE:/ <lfs_ekko>-ebeln,
*             <lfs_ekko>-aedat.
*  ENDLOOP.

*DESCRIBE TABLE lt_ekko LINES lv_count.
*---------------------------------------------------------------------------------------------------------------
*****************************************NEW WAY*********************************
  LOOP AT lt_ekko INTO DATA(ls_ekko).
     WRITE:/ ls_ekko-ebeln,
                      ls_ekko-aedat.
  ENDLOOP.

  LOOP AT lt_ekko ASSIGNING FIELD-SYMBOL(<lfs_ekko>).
     WRITE:/ <lfs_ekko>-ebeln,
                      <lfs_ekko>-aedat.
  ENDLOOP.

  DESCRIBE TABLE lt_ekko LINES DATA(lv_count).
*---------------------------------------------------------------------------------------------------------------



*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* On the fly READ operation.
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

*---------------------------------------------------------------------------------------------------------------
****************************************OLD WAY***********************************
*  DATA: ls_ekko_2 TYPE ty_ekko.
*  READ TABLE lt_ekko INTO ls_ekko_2 INDEX 2.
*  IF sy-subrc IS INITIAL.
*  WRITE:/ '2nd PO found'.
*  ENDIF.

*  DATA: ls_ekko_cond TYPE ty_ekko.
*  READ TABLE lt_ekko INTO ls_ekko_cond WITH KEY ebeln = '4500017750'.
*  IF sy-subrc IS INITIAL.
*  WRITE:/ 'PO found'.
*  ENDIF.

*  DATA: ls_ekko_exist TYPE ty_ekko.
*  READ TABLE lt_ekko WITH KEY ebeln = '4500017750'
*                              TRANSPORTING NO FIELDS.
*  IF sy-subrc IS INITIAL.
*    WRITE:/ 'PO Exist'.
*  ENDIF.

*---------------------------------------------------------------------------------------------------------------
*****************************************NEW WAY*********************************
  DATA(ls_ekko_2) = lt_ekko[ ].
  WRITE:'2nd PO found'.

  DATA(ls_ekko_cond) = lt_ekko[ ebeln '4500017750' ].
  WRITE:'PO found'.

  IF line_existslt_ekko[ ebeln '4500017750' ).
    WRITE:'PO Exist'.
  ENDIF.



Here is some more examples which will help you to explore more into ABAP 7.40

C:\Users\Partha\Desktop\HANA\image004.jpg

C:\Users\Partha\Desktop\HANA\image006.jpg