2013 Jul 09 12:51 PM
Dear Experts,
I have an requirement for creating of Custom infotype as below
In the infotype out screen should have one field with dropdown List 1,2,3 Etc
Upon selecting any in the drop down relevant fields should pop up with in the screen only.
For Example: In the drop list contains 1) Laptop
2) Desktop
3) Printer
Once if I select Laptop I should get fields pop up relevant to it so that I can maintain relevant of that particular product Like MAKE, MODEL, and PRODUCT SERIAL No. Etc.
2013 Jul 11 6:22 AM
Hi,
First create the custom info type with the required fields in which one field should have drop down list.
To satisfy the requirement i.e, to get pop up when selecting any field in the drop down list within the screen, we need to change the layout of the screen 2000. In the layout change the field property for which u want the drop down list as list box, so that it appears like drop down list and also disable all the other fields.To achieve this go to PBO of this screen and write the code.
For ex.LOOP AT screen.
IF screen-group3 = 002 or screen-group3 = 003 or screen-group3 = 004.
Screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
then in the PAI create a module and write the code for setting the relevant fields for the selected field.
For ex.
MODULE GETPROD INPUT.
CASE SY-UCOMM.
WHEN 'PROD'.
IF P9444-ZPRODUCT = 'LAPTOP'.
FLAG = 1.
ELSEIF P9444-ZPRODUCT = 'DESKTOP'.
FLAG = 2.
ELSEIF P9444-ZPRODUCT = 'PRINTER'.
FLAG = 3.
ENDIF.
CALL SCREEN 9001 STARTING AT 5 5.
ENDCASE.
ENDMODULE.
Now for the pop up we need to create a new screen and design the layout with the relevant fields from the custom info type which you have created. Now in the PBO of the screen create a module and write the code for displaying only the relevant fields for the selected once from the drop down list.
For ex.
MODULE DISPLAY OUTPUT.
IF FLAG = 1.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 002 OR SCREEN-GROUP1 = 003.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF FLAG = 2.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 001 OR SCREEN-GROUP1 = 003.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF FLAG = 3.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 001 OR SCREEN-GROUP1 = 002.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR FLAG.
ENDMODULE.
Dear Experts,
I have an requirement for creating of Custom infotype as below
In the infotype out screen should have one field with dropdown List 1,2,3 Etc
Upon selecting any in the drop down relevant fields should pop up with in the screen only.
For Example: In the drop list contains 1) Laptop
2) Desktop
3) Printer
Once if I select Laptop I should get fields pop up relevant to it so that I can maintain relevant of that particular product Like MAKE, MODEL, and PRODUCT SERIAL No. Etc.
2013 Jul 11 6:22 AM
Hi,
First create the custom info type with the required fields in which one field should have drop down list.
To satisfy the requirement i.e, to get pop up when selecting any field in the drop down list within the screen, we need to change the layout of the screen 2000. In the layout change the field property for which u want the drop down list as list box, so that it appears like drop down list and also disable all the other fields.To achieve this go to PBO of this screen and write the code.
For ex.LOOP AT screen.
IF screen-group3 = 002 or screen-group3 = 003 or screen-group3 = 004.
Screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
then in the PAI create a module and write the code for setting the relevant fields for the selected field.
For ex.
MODULE GETPROD INPUT.
CASE SY-UCOMM.
WHEN 'PROD'.
IF P9444-ZPRODUCT = 'LAPTOP'.
FLAG = 1.
ELSEIF P9444-ZPRODUCT = 'DESKTOP'.
FLAG = 2.
ELSEIF P9444-ZPRODUCT = 'PRINTER'.
FLAG = 3.
ENDIF.
CALL SCREEN 9001 STARTING AT 5 5.
ENDCASE.
ENDMODULE.
Now for the pop up we need to create a new screen and design the layout with the relevant fields from the custom info type which you have created. Now in the PBO of the screen create a module and write the code for displaying only the relevant fields for the selected once from the drop down list.
For ex.
MODULE DISPLAY OUTPUT.
IF FLAG = 1.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 002 OR SCREEN-GROUP1 = 003.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF FLAG = 2.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 001 OR SCREEN-GROUP1 = 003.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF FLAG = 3.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 001 OR SCREEN-GROUP1 = 002.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR FLAG.
ENDMODULE.
2013 Jul 11 12:35 PM
Hi ,
Check this may this helpful for Creating Custom Infotype.
Step 1. Creating the PSnnnn Structure
Each infotype requires a PS structure which contains all the data fields.
To create the ‘PS structure’, go to transaction code PM01.
Give a four digit number between 9000 – 9999 in the ‘Infotype no.’ field. Select the radio button ‘Employee infotype’. Select the radio button ‘PS Structure’ and then click on the ‘Edit’ button.
After pressing the ‘Edit’ button you will see the ‘Dictionary: Maintain Structure’ screen. Here, give a short description of your infotype and also give the data fields which are required in your infotype.
After providing all the required fields, press the save button.
Now, click on ‘Extras’ → ‘Enhancement Category’ to maintain the enhancement category for the PS structure.
Select ‘Can be enhanced (character-type or numeric)’.
Click on the ‘Copy’ button and then Click on Save, Check and finally Activate. This completes our first step. Now, click the ‘Back’ button to go back to the initial screen of PM01.
After creating your PS structure, return back to the initial screen of PM01.
By, clicking on the ‘Generate Objects’ button, you will see ‘n’ numbers of pop-up screen which will ask for confirmation to generate the object. Keep pressing the continue (enter) button until all the objects are created.







There will be some more screens, just keep on pressing continue (enter) button to proceed.
In this step you will maintain the infotype characteristics such as ‘Infotype Description’ and ‘General Attributes’, properties for ‘Display and Selection’ and ‘Technical Data’.
Click on ‘Infotype characteristics’.
You will see the ‘Infotypes attributes’ Table View. Click on change icon.

And then click on the ‘New Entries’ button to create a new entry.

Now, you will see the screen where you can provide the infotype characteristics.
Before, proceeding further you should know about the following important characteristics of an infotype.
Time Constraints: This characteristic determines if more than one infotype record can exist at the same period in time per employee.
The following values of time constraints are accepted.

Date Reaction Indicators: They control the search type, when “no dates”, “one date” or “two dates” are entered on the selection screen.
As per your requirement select the Time Constrains and the Date Reaction Indicators.
In this step you will maintain the technical attributes of the infotype such as – Dialog Module, Database Table and Structure. All these objects (except the structure) are automatically generated in Step 2 by pressing the ‘Generates Objects’ button.
You will see the ‘Infotype Dialog/Database assignment’ table view. Click on the change button.
Now click on ‘Position’ button and enter the name of your infotype.
Select your infotype and click on the ‘Display Button
By default, all the values should come appear automatically, if not then enter them manually.
Click on SAVE and assign your development to a transport request.
Now, we will make some changes in the infotype screen using the screen painter.
At the Initial screen of transaction PM01, select the ‘Screen’ radio button under the ‘Subobjects’ tab and enter the screen number as ‘2000’. Then press the ‘Edit’ button.

Select the ‘Layout’ radio button and then click on ‘Change’ button.

Make the required changes in the screen layout. Save, check and then activate.
To check the output, go to transaction code PA30. Enter employee number and click on the create button.