Visit the SAP Forum

Languages : English | Dutch | French | Portugese | Italian



INTERVIEW EBOOK
Get 30,000 Interview Questions & Answers in an eBook.

Interview Success Kit - Get Success in Job Interviews



Send your Resume to 6000 Companies
START YOUR WEBSITE
India's Best Web Hosting Company

Usage of 'for all entries' in Select Statement


Home »ABAP Programming » for all entries in Select Statement


"Usage of 'for all entries' in Select Statement

FORM data_retrieval.

  DATA: ld_color(1) TYPE c.

  DATA: BEGIN OF T_VBAP OCCURS 0,
        VBELN  LIKE VBAP-VBELN,
        MATNR  LIKE VBAP-MATNR,
        POSNR  LIKE VBAP-POSNR,
        END OF T_VBAP.

  DATA: BEGIN OF T_VBFA OCCURS 0,         VBELV  LIKE VBFA-VBELV,         VBELN  LIKE VBFA-VBELN,         VBTYP_N  LIKE VBFA-VBTYP_N,         END OF T_VBFA.   DATA: BEGIN OF T_VBAK OCCURS 0,         VBELN  LIKE VBAK-VBELN,         IHREZ  LIKE VBAK-IHREZ,         END OF T_VBAK.   DATA: BEGIN OF T_KNA1 OCCURS 0,         KUNNR  LIKE KNA1-KUNNR,         NAME1  LIKE KNA1-NAME1,         END OF T_KNA1.    DATA: BEGIN OF T_MAKT OCCURS 0,         MATNR  LIKE MAKT-MATNR,         MAKTX  LIKE MAKT-MAKTX,         END OF T_MAKT.   SELECT likp~vbeln likp~lifex likp~bldat likp~wadat likp~wadat_ist likp~kodat likp~lfart          likp~kunnr likp~vstel lips~posnv lips~lfimg lips~vrkme lips~lgmng lips~meins          lips~werks lips~lgort lips~charg lips~vbelv lips~posnr lips~matnr          lips~vbeln LIPS~VGBEL LIPS~VGPOS vbup~kosta vbup~wbsta vbup~posnr vbup~vbeln *           VBAK~IHREZ VBAK~VBELN VBAP~VBELN      INTO CORRESPONDING FIELDS OF TABLE  it_itab     FROM ( likp            INNER JOIN lips            ON  lips~vbeln = likp~vbeln            INNER JOIN vbup            ON  vbup~posnr = lips~posnr            and VBUP~VBELN = LIPS~VBELN ) *           left outer join VBAK *           on  VBAK~VBELN = LIPS~VGBEL *           inner join VBAP *           on  VBAP~VBELN = VBAK~VBELN )          WHERE likp~vbeln IN so_vbeln            AND likp~lifex IN so_lifex            AND likp~lfart IN so_lfart            AND likp~kunnr IN so_kunnr            AND likp~vstel IN so_vstel            AND likp~bldat IN so_bldat            AND likp~wadat_ist IN so_wadat            AND vbup~kosta IN so_kosta            AND vbup~wbsta IN so_wbsta            AND LIPS~LFIMG NE 0.   SELECT VBELN IHREZ INTO TABLE T_VBAK   FROM VBAK   FOR ALL ENTRIES IN  IT_ITAB   WHERE VBELN = IT_ITAB-VGBEL. *  APPEND T_VBAK. *  ENDSELECT.   SELECT VBELN MATNR POSNR INTO TABLE T_VBAP   FROM VBAP   FOR ALL ENTRIES IN  IT_ITAB   WHERE VBELN = IT_ITAB-VGBEL AND         MATNR = IT_ITAB-MATNR AND         POSNR = IT_ITAB-VGPOS. *  APPEND T_VBAP. *  ENDSELECT.   SELECT VBELV VBELN VBTYP_N INTO TABLE T_VBFA   FROM VBFA   FOR ALL ENTRIES IN  IT_ITAB   WHERE VBELV = IT_ITAB-VBELN AND         VBTYP_N = 'M' .   SELECT KUNNR NAME1 INTO TABLE T_KNA1   FROM KNA1   FOR ALL ENTRIES IN IT_ITAB   WHERE KUNNR = IT_ITAB-KUNNR. *  APPEND T_KNA1. *  ENDSELECT.   SELECT MATNR MAKTX INTO TABLE T_MAKT   FROM MAKT   FOR ALL ENTRIES IN IT_ITAB   WHERE MATNR = IT_ITAB-MATNR. *  APPEND T_MAKT. *  ENDSELECT. *Populate field with color attributes   LOOP AT it_itab INTO wa_ITAB. * Populate color variable with colour properties * Char 1 = C (This is a color property) * Char 2 = 3 (Color codes: 1 - 7) * Char 3 = Intensified on/off ( 1 or 0 ) * Char 4 = Inverse display on/off ( 1 or 0 ) * i.e. wa_ekko-line_color = 'C410'     REFRESH color.     colourize 'VBELN' 0. " .     WA_ITAB-farbe = color[].     ld_color = ld_color + 1. * Only 7 colours so need to reset color value     IF ld_color = 3. "8       ld_color = 1.     ENDIF.     CONCATENATE 'C' ld_color '10' INTO wa_ITAB-line_color.     WA_ITAB-NAME1 = ''.     WA_ITAB-MAKTX = ''.     WA_ITAB-IHREZ = ''.     WA_ITAB-VBELV = ''.     READ TABLE T_KNA1 WITH KEY KUNNR = WA_ITAB-KUNNR.     IF SY-SUBRC = 0.        WA_ITAB-NAME1 = T_KNA1-NAME1.     ENDIF.     READ TABLE T_MAKT WITH KEY MATNR = WA_ITAB-MATNR.     IF SY-SUBRC = 0.     WA_ITAB-MAKTX = T_MAKT-MAKTX.     ENDIF.     READ TABLE T_VBAK WITH KEY VBELN = WA_ITAB-VGBEL.     IF SY-SUBRC = 0.     WA_ITAB-IHREZ = T_VBAK-IHREZ.     ENDIF.     READ TABLE T_VBFA WITH KEY VBELV = WA_ITAB-VBELN.     IF SY-SUBRC = 0.     WA_ITAB-VBELVA = T_VBFA-VBELN.     ENDIF. *    READ TABLE T_VBAP WITH KEY VBELN = WA_ITAB-VGBEL *                               POSNR = WA_ITAB-VGPOS *                               MATNR = WA_ITAB-MATNR. *    IF SY-SUBRC = 0. *    WA_ITAB-IHREZ = T_VBAK-IHREZ. *    ENDIF. * wa_ekko-line_color = 'C410'.     MODIFY it_itab FROM wa_itab.   ENDLOOP. ENDFORM. " data_retrieval
A D V E R T I S E M E N T

A D V E R T I S E M E N T

S A P - R E S O U R C E S


Get Free SAP Resources:

Are you looking for:
  • SAP Jobs
  • Free SAP eBooks
  • SAP Softwares
  • SAP Tutorials
  • ERP Implementation Examples
Enter Email Address:
(Enter your email address above and we will instantly send you the download link to you, when you confirm your email.)
Search SAP Resources:
discussionDiscussion Center
Discuss
Discuss

Query

Feedback
Yahoo Groups
Y! Group
Sirfdosti Groups
Sirfdosti
Contact Us
Contact
Sign in

User Name:
Password:
Forget password? | Register


INTERVIEW EBOOK

Get 30,000 Interview Questions & Answers in an eBook.

Interview Success Kit - Get Success in Job Interviews


Send your Resume to 6000 Companies

SAP Resources

  • SAP Articles
  • SAP Books
  • SAP Certifications
  • SAP Companies
  • SAP Study Materials
  • SAP Events
  • SAP Faqs
  • SAP Jobs
  • SAP Job Consultants
  • SAP Links
  • SAP News
  • SAP Sample Papers
  • SAP Interview Questions
  • SAP Training Institutes
  •  
    SAP Tutorial

  • Introduction
  • SAP History
  • SAP Facts
  • SAP Tables
  • SAP Function
  • SAP Report
  • Reasons To Use SAP
  • SAP Landscape
  • SAP Transaction Code
  • SAP Lotus Notes Integration
  • Business Connector and XML
  • Enterprise Release 4.7

  • SAP Training Institutes

  • SAP Training Institutes
  • Job Consultants Address
  • SAP Companies Address

  • Business Process Cycle

  • Analyze
  • Design
  • Implement
  • Operate
  • Optimize
  • Skills And Education

  • Logistics Module

  • Sales and Distribution
  • Quality Management
  • Materail Management
  • Plant Maintenance
  • Financial Modules (FI/CO)
  • Project system
  • Production Planning
  • Service Management

  • SAP NetWeaver

  • Introduction
  • Object Model
  • Interoperability
  • Creating Web Apps
  • Java Connector
  • Advantages & Conclusion
  • Life Cycle Management
  • Composite Application Framework

  • SAP Tools

  • SQL Trace Tool
  • SAP CRM
  • SAP SRM
  • SAP SCM
  • SAP ERP
  • SAP BW

  • SAP Modules

  • SAP FI Module
  • SAP CO Module

  • SAP Technical

  • SAP ITS Architecture
  • Financial Management
  • Manufacturing Planning and Execution
  • Customer Order Management
  • Lackbox Processing
  • SD and Financial Accounting Integration
  • SAP - HR (Human Resource)

  • SAP Miscellanous

  • Web Application Server(WAS)
  • Data Archiving
  • Mobile Engine
  • SAP Script
  • SAP Transactions
  • SAP Business Warehouse(BW)

  • SAP Reference

  • SAP Facts
  • SAP Tables
  • SAP Function
  • SAP Report
  • SAP Landscape

  • SAP Others

  • SAP Treasury
  • SAP Finance
  • SAP WAS
  • SAP Data Archiving
  • SAP ALE
  • SAP EDI
  • SAP Exchange
  • SAP X-APPS
  • SAP Applications Components
  • SAP Software
  • Dunning
  • SAP IDES
  • SAP Payroll Basics
  • SAP BASIS and Security Authorization
  • SAP Backup
  • SAP Router

  • ABAP Tutorials

  • Introduction
  • ABAP Transaction
  • ABAP Function
  • ABAP File Processing
  • ABAP Objects
  • ABAP Syntax
  • ABAP Queries
  • SAPMail Using ABAP
  • ABAP Programming Hints

  • SAP Projects & Codes

  • Finding the user-exits
  • Purchase Order Display
  • Batch Input
  • Dynamic Open SQL
  • Creating Extract Dataset
  • Reading database tables
  • Load table from a UNIX file
  • Create subscreen

  • SAP Resources

  • SAP Books
  • SAP Links

  • Interview Question



  • Common Interview Que.
  • ABAP Interview Que.
  • ERP Interview Que.
  • HR Interview Que.
  • MM Interview Que.
  • PP Interview Que.
  • ALE Interview Que.
  • EDI Interview Que.
  • Basis Interview Questions
  • SAP-SD Interview Questions
  • FI&CO Interview Questions
  • BW Interview Questions
  • CRM Interview Questions
  • Interview Questions

  • Careers at SAP

  • Careers in SAP (SAP Jobs)
  • Advertise
  •