<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ABAP REPORT pgm in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135204#M449119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;**&lt;STRONG&gt;DO THE REQUIRED DATA DECLARATION&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin  OF BLCK B1 WITH FRAME TITLE TEXT-001.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: S_DOC FOR TABLENAME-FIELD(DOCNU).&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK B1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SELECT * FROM EKKO&lt;/P&gt;&lt;P&gt;         INTO TABLE IT_EKKO&lt;/P&gt;&lt;P&gt;         WHERE DOCNO IN S_DOC&lt;/P&gt;&lt;P&gt;           AND  ( BSART = 'ZFR' 0R&lt;/P&gt;&lt;P&gt;                 BSART = 'ZPA').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM EKPO&lt;/P&gt;&lt;P&gt;        INTO TABLE IT_EKPO&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN IT_EKKO&lt;/P&gt;&lt;P&gt;          WHERE EBELN = IT_EKKO-EBELN&lt;/P&gt;&lt;P&gt;            AND EBELN = '0010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_EKPO INO WA_EKPO.&lt;/P&gt;&lt;P&gt;   IF NOT IT_EKPO-LOEKZ IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT STPRS FROM MBEW&lt;/P&gt;&lt;P&gt;        INTO V_STPRS&lt;/P&gt;&lt;P&gt;         WHERE MATNR = WA_EKPO-MATNR AND&lt;/P&gt;&lt;P&gt;               BWKEY = WA_EKPO-WERKS.&lt;/P&gt;&lt;P&gt;   ELSE.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION MODULES AND PASS THE PARAAMETERS ACCORDINGLY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      Create Log with following message :&lt;/P&gt;&lt;P&gt;Contract Number : EKKO-NUMBER : XXXX&lt;/P&gt;&lt;P&gt;Message : return-message ( this one we want to see in SM36)&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2007 05:28:23 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-05T05:28:23Z</dc:date>
    <item>
      <title>ABAP REPORT pgm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135201#M449116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am Deethya, i am new in ABAP .so now i am doing one ABAP Report object can anyone help me how to write ABAP REPORT, here i attached my requrirement plz give me some suggestion i will give good points because this is my first program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: &lt;/P&gt;&lt;P&gt;Selection screen : Document Number ( Multiple Selection)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2: &lt;/P&gt;&lt;P&gt;Select all lines from EKKO where ( BSART = ZFR or BSART = ZPA).Check document number if it was filling in selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3: &lt;/P&gt;&lt;P&gt;Select the first line from EKPO where EBELN = EKKO &amp;#150; EBELN and &lt;/P&gt;&lt;P&gt;EKPO &amp;#150; EPELP = &amp;#145;0010&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4: &lt;/P&gt;&lt;P&gt;EKPO &amp;#150; LOEKZ is initial? &lt;/P&gt;&lt;P&gt;IF YES go to STEP 5 &lt;/P&gt;&lt;P&gt;IF NO go to STEP 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 5: &lt;/P&gt;&lt;P&gt;Select STPRS from MBEW where MATNR = EKPO &amp;#150; MATNR and &lt;/P&gt;&lt;P&gt;BWKEY = EKPO &amp;#150; WERKS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 6: &lt;/P&gt;&lt;P&gt;Call function Z_BAPI_PO_CHANGE and the informed parameters are&lt;/P&gt;&lt;P&gt;Purchaseorder = EKKO &amp;#150; EBELN,&lt;/P&gt;&lt;P&gt;POITEM &amp;#150; po_item = EKPO &amp;#150; EBELP,&lt;/P&gt;&lt;P&gt;POITEM &amp;#150; net_price = MBEW &amp;#150; STPRS,&lt;/P&gt;&lt;P&gt;POITEMX &amp;#150; po_item = EKPO &amp;#150; EBELP,&lt;/P&gt;&lt;P&gt;POITEMX &amp;#150; net_price = &amp;#145;X&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 7: &lt;/P&gt;&lt;P&gt;This function will fill in the return table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 8:&lt;/P&gt;&lt;P&gt;Is there message type = E?&lt;/P&gt;&lt;P&gt;IF YES go to STEP 9&lt;/P&gt;&lt;P&gt;IF NO go to STEP 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 9:&lt;/P&gt;&lt;P&gt;Create Log with following message :&lt;/P&gt;&lt;P&gt;Contract Number : EKKO-NUMBER : XXXX&lt;/P&gt;&lt;P&gt;Message : return-message ( this one we want to see in SM36)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 10:&lt;/P&gt;&lt;P&gt;Finish File&lt;/P&gt;&lt;P&gt;IF NO go to STEP 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards,&lt;/P&gt;&lt;P&gt;deethya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 12:42:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135201#M449116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-04T12:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP REPORT pgm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135202#M449117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code is almost there in the given requirement itself. Any way have a look at the pseudo code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: i_ekko type standard table of ekko,
        i_ekpo type standard table of ekpo.

data: w_ekko type ekko,
        w_ekpo type ekpo.

data: v_stprs like mbew-stprs.
Select-options: s_vbeln for ekko-ebeln.

select * from EKKO into table i_ekko where ebeln in s_vbeln and ( BSART = 'ZFR' or BSART = 'ZPA' ).

if sy-subrc = 0.
  select * from ekpo into table i_ekpo for all entries in i_ekko where ebeln = i_ekko-ebeln and epelp = '0010'.
if sy-subrc = 0.
loop at i_ekpo into w_ekpo.
if wa_ekpo-loekz is initial.
clear v_stprs.
Select STPRS from MBEW into v_stprs up to 1 rows where MATNR = EKPO &amp;#150; MATNR and BWKEY = EKPO &amp;#150; WERKS.
endselect.
if sy-subrc = 0.
* the function module u have provided is a 'Z' Function module. So, check the 
* parameters and call the FM with appropriate records.
* After calling the function module, read the RETURN parameter with TYPE = 'E'.
If sy-subrc = 0.
* Write the log in appropriate format using WRITE statement
* if the program executes in background then the output will go to SM36 automatically.
endif.

endif.
else.
endif.
clear: w_ekpo.
endloop.
endif.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phani.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2007 13:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135202#M449117</guid>
      <dc:creator>PS_1978</dc:creator>
      <dc:date>2007-04-04T13:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP REPORT pgm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135203#M449118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have done some of your basic requirements. Please reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF SCREEN 1001.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.&lt;/P&gt;&lt;P&gt;DATA ITAB TYPE EKKO.&lt;/P&gt;&lt;P&gt;SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF ITAB WHERE EBELN IN S_EBELN AND EKKO-EBELP = '0010'.&lt;/P&gt;&lt;P&gt;DATA LOEKZ TYPE EKPO-LOEKZ.&lt;/P&gt;&lt;P&gt;IF LOEKZ IS INITIAL&lt;/P&gt;&lt;P&gt;SELECT SINGLE STPRS FORM MBEW INTO DT_STPRS WHERE &amp;lt;CONDITION&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION (FUNCTION IS CALLED BY CLICKING ON PATTERN.)&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 04:54:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135203#M449118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T04:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP REPORT pgm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135204#M449119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;**&lt;STRONG&gt;DO THE REQUIRED DATA DECLARATION&lt;/STRONG&gt;***&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin  OF BLCK B1 WITH FRAME TITLE TEXT-001.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: S_DOC FOR TABLENAME-FIELD(DOCNU).&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK B1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;SELECT * FROM EKKO&lt;/P&gt;&lt;P&gt;         INTO TABLE IT_EKKO&lt;/P&gt;&lt;P&gt;         WHERE DOCNO IN S_DOC&lt;/P&gt;&lt;P&gt;           AND  ( BSART = 'ZFR' 0R&lt;/P&gt;&lt;P&gt;                 BSART = 'ZPA').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM EKPO&lt;/P&gt;&lt;P&gt;        INTO TABLE IT_EKPO&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN IT_EKKO&lt;/P&gt;&lt;P&gt;          WHERE EBELN = IT_EKKO-EBELN&lt;/P&gt;&lt;P&gt;            AND EBELN = '0010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_EKPO INO WA_EKPO.&lt;/P&gt;&lt;P&gt;   IF NOT IT_EKPO-LOEKZ IS INITIAL.&lt;/P&gt;&lt;P&gt;    SELECT STPRS FROM MBEW&lt;/P&gt;&lt;P&gt;        INTO V_STPRS&lt;/P&gt;&lt;P&gt;         WHERE MATNR = WA_EKPO-MATNR AND&lt;/P&gt;&lt;P&gt;               BWKEY = WA_EKPO-WERKS.&lt;/P&gt;&lt;P&gt;   ELSE.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION MODULES AND PASS THE PARAAMETERS ACCORDINGLY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      Create Log with following message :&lt;/P&gt;&lt;P&gt;Contract Number : EKKO-NUMBER : XXXX&lt;/P&gt;&lt;P&gt;Message : return-message ( this one we want to see in SM36)&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 05:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135204#M449119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T05:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP REPORT pgm</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135205#M449120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;thanks for your help.it's really help for my first Report progam.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards,&lt;/P&gt;&lt;P&gt;deethya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2007 17:37:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-report-pgm/m-p/2135205#M449120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-05T17:37:15Z</dc:date>
    </item>
  </channel>
</rss>

