Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CALLING ANOTHER PROGRAM

Former Member
0 Likes
1,501

Suppose I have 2 report programs.

REPORT prog1.

write 'A'.

and another report program

REPORT prog2.

WAIT UP TO 4 SECONDS.

Write / 'B'.

NOW.

How can i call prog2 from prog 1 such that Both program 1 and prog 2 runs in parallel

NOTE:

If we use "SUBMIT PROG2 AND RETURN"

or "SUBMIT PROG2 EXPORTING LIST TO MEMORY AND RETURN" Then the programms wont run in parallel. 1st prog2 will run and return to prog1. BUT HOW CAN I RUN OUR PROGRAMMS IN PARALLEL ?

The requirement is :

Prog2 is called 1st but the WRITE of prog1 is printed 1st.

OUTPUT IS:

A

B

Edited by: Noman Hussain on Apr 3, 2008 9:57 AM

2 REPLIES 2
Read only

Former Member
0 Likes
853

I cant really understand your requirement, is the problem with the report output or with parallel executions? If you need to display the output from first program and then display output from second program in same list example provided in your other thread will do the task. Finish the WRITE statement of first program, SUBMIT the second program and append the output to the initial list. If the problem is with Parallel executions do as below, build a wrapper program which can submit both progams and display in single list though i beleive it wouldnt make much of difference:

DATA: i_list_1 TYPE TABLE OF  abaplist,
      i_list_2 TYPE TABLE OF  abaplist.

SUBMIT zreport1 EXPORTING LIST TO MEMORY AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = i_list_1
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.

SUBMIT zreport2 EXPORTING LIST TO MEMORY AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = i_list_2
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.
*
CALL FUNCTION 'WRITE_LIST'
  EXPORTING
    write_only = 'X'
  TABLES
    listobject = i_list_1
  EXCEPTIONS
    empty_list = 1
    OTHERS     = 2.


CALL FUNCTION 'WRITE_LIST'
  EXPORTING
    write_only = 'X'
  TABLES
    listobject = i_list_2
  EXCEPTIONS
    empty_list = 1
    OTHERS     = 2.
And try to continue in the same thread rather than opening multiple threads on the same topic. Should you have any concerns you could raise here so everyone answering the post would know the problem.

Read only

Former Member
0 Likes
853

Hi Hussain,

hi,

Dictionary

The ABAP/4 Data Dictionary is the central component of ABAP/4 Repository.

It is centralised and structured source of information for business applications

It is the source of every every definition with in R/3 system.

It is totally integrated with other tools of Dev. environment like Screen painter etc.,

Some of the main available functions in the ABAP/4 Dict.

Management of data definitions (Select, Insert, Update and Delete)

Preserve data integrity.

Information about the defined relationship between two tables or even dictionary tells whether table is active or empty.

Dictionary Objects

Tables

Structures

View

Data element

Domain

Lock Objects and

Search Helps

check these sites:

http://sapabap.iespana.es/sapabap/manuales/learnabap/

http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ea31446011d189700000e8322d00/frameset.htm

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBDIC/BCDWBDIC.

http://cma.zdnet.com/book/abap/ch03/ch03.htm

********************************

domain

A table is composed of fields. To create a field you need a data element.A data element's definition requires a domain.

The domain contains the technical characteristics of a field, such as the field length and data type.

When you create a new field, you must decide whether to create a new domain or reuse an existing one. To make this decision, determine whether the data type or length of your field should be dependent on an existing SAP field. If your field should be independent, create a new domain. If your field should be dependent, reuse an existing SAP domain. Similarly, you should reuse data elements if your field labels and documentation should change when SAP changes theirs.

**********************************8

Data element provides business context. i.e., it provides field labels for the field in the backend,

Data type :

A data element is an elementary type. It describes the type attributes (data type, field length and possibly the number of decimal places) and screen information (explanatory text or field help) about unstructured data objects (table fields and structure fields or variables).

Table fields and structure fields with the same contents should refer to the same data element. This ensures that the attributes of these fields are always consistent.

A data element can be referenced in ABAP programs with TYPE. This permits you to define variables that take on the type attributes of the data element in an ABAP program.

Domain :

A domain describes the technical attributes of a field, such as the data type or the number of positions in a field. The domain defines primarily a value range describing the valid data values for the fields referring to this domain.

Different technical fields of the same type can be combined in a domain. Fields referring to the same domain are changed at the same time when a domain is changed. This ensures the consistency of these fields.

Additional info about data element

1.Data type, number of places and possibly the decimal places were entered directly. In this case the field is not filled.

2.A data element is assigned to the field. The field then gets its data type, length and possibly decimal places from this data element. The semantic attributes of the element (field help, representation of the field in input templates with keyword text, column headers for list output of the table contents and editing of the output with parameter IDs) are also copied.

  • How To Pass Data Between Two Programs*

Passing Data Using Internal Memory Areas

ABAP programs have access to two cross-program memory areas that can be used for passing data.

SAP Memory

SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program at the time of logon using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).

ABAP Memory

ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this memory area remains throughout a sequence of program calls, with the exception of LEAVE TO TRANSACTION. To pass data to a program that you are calling, the data needs to be placed in ABAP memory before the call is made from the internal calling session using the EXPORT statement. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory using the IMPORT statement. If control is then returned to the program that made the initial call, the same procedure operates in reverse (see also Storage Media for Data Cluster). If a transaction is called using LEAVE TO TRANSACTION, the ABAP memory and the call stack are deleted. They cannot be used for data transfer.

Since objects belonging to ABAP objects can only be accessed within an internal session, it does not make sense and is therefore forbidden (from a syntax point of view) to pass a reference to an object to a calling program through the ABAP memory.

Kindly Reward Points If You Found The Reply Helpful,

Cheers,

Chaitanya.